I'm running ubuntu 16.04 and installed LAMP this way:
Install Apache
sudo apt-get install apache2
Install MySQL
sudo apt-get install mysql-server
Install PHP
sudo apt-get install php7.0 libapache2-mod-php7.0
Restart Server
sudo /etc/init.d/apache2 restart
Check Apache
Working
Check PHP
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
Working
Files structure:
/var/www/html/index.html > redirects to index.php /var/www/html/pages/index.php < this file is not working and all php files
The owner group is set to:
chown -R www-data:www-data /var/www
The folders permissions are 755. The index.php permssions is 644 This is my apache2.conf file: https://ghostbin.com/paste/wwhog
But when i go to: http://localhost/pages/index.php I get this 403 Forbidden error. It seems like i can't see php files.
www-data
not your user unless you have added it to www-data group. fixing permissions is the quickest way to break it. – Lawrence Cherone