美文网首页
Apache及php的安装及使用

Apache及php的安装及使用

作者: 敢想敢做_ | 来源:发表于2018-09-11 20:36 被阅读0次

一.Apache部分

安装

sudo apt-get install apache2

启动apache服务
/etc/init.d/apache2 start
sudo /etc/init.d/apache2 start
重启apache服务
 /etc/init.d/apache2 restart
$ sudo /etc/init.d/apache2 restart
停止apache服务
 /etc/init.d/apache2 stop
$ sudo /etc/init.d/apache2 stop

Apache安装完成后项目文件路径为:/var/www/html

二.php的安装

sudo apt-get install php7.0
sudo apt-get install libapache2-mod-php7.0
sudo apt-get install php7.0-mysql

安装完成后 运行php -v可查看是否安装成功,libapache2-mod-php7.0包用于让apache支持php7,也就是能解析php7,php7.0-mysql用于提供php能够使用的访问mysql的接口

相关文章

网友评论

      本文标题:Apache及php的安装及使用

      本文链接:https://www.haomeiwen.com/subject/papegftx.html