我正在运行 ubuntu 16.04 并以这种方式安装 LAMP:
安装 Apache
sudo apt-get install apache2
安装 MySQL
sudo apt-get install mysql-server
安装 PHP
sudo apt-get install php7.0 libapache2-mod-php7.0
重启服务器
sudo /etc/init.d/apache2 restart
检查 Apache
Working
检查 PHP
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
在职的
文件结构:
/var/www/html/index.html > redirects to index.php /var/www/html/pages/index.php < this file is not working and all php files
所有者组设置为:
chown -R www-data:www-data /var/www
文件夹权限为 755。 index.php 权限为 644 这是我的 apache2.conf 文件:https://ghostbin.com/paste/wwhog
但是当我去:http://localhost/pages/index.php我得到这个 403 Forbidden 错误。好像我看不到php文件。
最佳答案
以下是一些解决方法。
检查 Apache 的错误日志文件将为您提供有关错误的更多信息。
关于php - 如何修复错误 403 错误 php 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47692648/