- 安装apache
sudo apt-get install apache2 -
浏览
http://localhost -
安装php5
sudo apt-get install php5 -
配置apache+php
sudo apt-get install libapache2-mod-php5 - 重启APACHE
sudo /etc/init.d/apache2 restart
此时可能会遇到错误:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0,解决方法httpd.conf在/etc/apache2中,把ServerName 127.0.0.1:80加入httpd.conf保存。然后重启apache.
- 测试
sudo gedit /var/www/test.php
输入内容:<?php phpinfo();?>
打开地址:http://localhost/test.php -
安装Mysql
sudo apt-get install mysql-server
安装完成按提示设置root密码. -
配置apache、php支持Mysql
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql -
重启APACHE
sudo /etc/init.d/apache2 restart