版本:deepin V20
0. Mysql安装
我已经在我的另一篇博客写了如何安装mysql,建议先安装
1. Apache安装
使用apt安装(如果刚装系统没有换源,建议先换源,mysql安装文章有写如何换源)
sudo apt-get install apache2
1.1 配置
没有什么特殊的配置,我觉得不要让apache占用我们的80端口就好
它的配置文件可能跟我们以前配置文件不在同个地方,在 /etc/apache2
里面有ports.conf,我们可以在里面修改我们的端口
sudo vim ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 8766
Listen 443
Listen 443
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
按i (进入编辑模式)
把Listen修改为 8766 或者你喜欢的端口
按esc键退出编辑模式
:wq写入并退出
2. PHP安装
sudo apt-get install php
3. 测试
重启Apache
service apache2 restart
service apache2 status (查看状态)
测试PHP环境
新建一个php文件
phpinfo();
?>
复制到 /var/www/html 文件夹
sudo mv test.php /var/www/html
访问 127.0.0.1:8766/test.php测试