安装好LAMP后,只是单纯将PHP工程放在/var/www/文件夹下,还无法打开网页,会提示没有权限
chmod -R 777 YourDirName
YourDirName是你www文件夹中PHP工程的文件名
如果放在其他目录下,如/var/tmp/
首先修改/etc/apache2/sites-enabled/下的000-default文件
将DocumentRoot /var/www改为DocumentRoot /DirYouWant
本例中即DocumentRoot /var/tmp
同时修改该目录的权限
chmod -R 777 /var/tmp
/etc/init.d/apache2 restart