Ubuntu安装apache+mysql+php

前几日没事闲的自己搞ubuntu安装LAMP环境,现在把自己一共执行过的命令都整理一下~

先安装apache

sudo apt-get install apache2

然后安装php

sudo apt-get install php7.0

如果遇到没有软件包的话就去search一下php

重启apache

sudo /etc/init.d/apache2 restart

安装mysql

sudo apt-get install mysql-server mysql-client

然后就装好啦。

apache的指令

重启:sudo /etc/init.d/apache2 restart

开启:sudo /etc/init.d/apache2 start   

关闭:sudo /etc/init.d/apache2 stop 

如何进入mysql:

mysql -u root -p 你的密码

比如密码是123456,那么就是

mysql -uroot -p 123456

你可能感兴趣的:(Ubuntu安装apache+mysql+php)