sudo apt-get install apache2#配置apache2
sudo apt-get install php5 libapache2-mod-php5 # 配置apache2和php5之间的连接关系
以上可能会出现如下错误
Package 'libapache2-mod-php5' has no installation candidate
解决方案
编辑 /etc/apt/sources.list 加上 deb http://ftp.es.debian.org/debian stable main contrib non-free
deb-src http://ftp.es.debian.org/debian stable main contrib non-free
deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
sudo apt-get update
sudo apt-get install libapache2-mod-php5
在/var/www/html下新建一个php文件名为phpinfo.php
输入内容:
phpinfo();#打印出php的配置信息。
?> 访问一下如果能够答应出php的配置信息的话,证明配置成功。