ubunto 搭建php环境

安装MySQL

  • sudo apt-get install mysql-server
  • 安装过程设置mysql密码
  • 使用mysql -u root -p命令输入密码登录数据库

安装apache2

  • 安装:sudo apt-get install apache2
  • 查看状态:service apache2 status 或 浏览器访问 localhost
  • 重启:service apache2 restart

安装php7.0

  • 安装sudo apt-get install libapache2-mod-php7.0 php7.0
  • 查看状态:php -v或者通过sudo nano /var/www/html/index.php创建index.php文件,浏览器输入http://localhost/index.php 进行访问

这里写图片描述
纪念一下安装成功的画面,感觉ubunto比centos好用


Note1
vmware ubuntu虚拟机与windows之间不能copy,和虚拟机窗口自适应
卸载:sudo apt-get remove open-vm-tools
重装:sudo apt-get install open-vm-tools-desktop
重启:sudo reboot

Note2
ubunto 大多需要 sudo 授权执行文件;安装文件用 apt-get,不用yum;用nano编辑文件,不用 vi

Note3
忘了哪个地方需要

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

参考资料

猜你喜欢

转载自blog.csdn.net/qq_39251267/article/details/80065033