http://domain/phpmyadmin login page not loading - error 403 forbidden
login page not loading - error 403 forbidden
Setup
Default Ubuntu 18.04 server added nginx & php using apt-get
Installed the latest version of phpmyadmin manually to avoid bug in the 18.04 release. ()
http:/domain/index.php worked fine and from there other php pages would load, via the website menu, so I assumed php was working correctly. A php page with phpinfo(); worked as expected.
I had just done the setup on an identical server without a problem. What had I forgotten? As phpmyadin was outside the /var/www/html folder I thought it was a folders permissions issue.
1 Answer
Analysis
Looked in /var/log/nginx/error.log
eg 403 error eg "GET /phpmyadmin/ HTTP/1.1" 403 152 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"
worked, bringing up the login page.
However, on its own would give a 403 error even though index.php was present.
Fix/etc/nginx/sites-available/default, added index.php, restarted the website
faulty version
# Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html;corrected version
# Add index.php to the list if you are using PHP index index.php index.html index.htm index.nginx-debian.html;