HTTP 500 error when accessing my website

June 19, 2016 977 views
LAMP Stack Apache

I tried logging onto my website today and found that there was a 500 error instead with the log below for apache2. I've run an update but to no avail.

[Sun Jun 19 00:23:55.966140 2016] [mpm_prefork:notice] [pid 1002] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.14 configured -- resuming normal operations
[Sun Jun 19 00:23:55.970722 2016] [core:notice] [pid 1002] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jun 19 00:24:00.932874 2016] [:error] [pid 1013] [client 58.104.40.170:53340] PHP Warning:  require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:00.932968 2016] [:error] [pid 1013] [client 58.104.40.170:53340] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:45.602576 2016] [:error] [pid 1012] [client 58.104.40.170:53930] PHP Warning:  require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:45.602743 2016] [:error] [pid 1012] [client 58.104.40.170:53930] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:46.081614 2016] [:error] [pid 1014] [client 58.104.40.170:53931] PHP Warning:  require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:46.081732 2016] [:error] [pid 1014] [client 58.104.40.170:53931] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:48.656707 2016] [:error] [pid 1015] [client 162.243.163.141:54440] PHP Warning:  require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 37
[Sun Jun 19 00:24:48.656810 2016] [:error] [pid 1015] [client 162.243.163.141:54440] PHP Fatal error:  require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/wp-load.php on line 37
1 Answer

The key part of this error message is:

Permission denied in /var/www/html/wp-load.php

The file's permission are configured in a way that prevents Apache from accessing it. My first guess would be that the files are owned by root and the www-data user can not access them. You can change their owner by running:

  • sudo chown -R www-data:www-data /var/www/html

Check out this tutorial for a full walkthrough on installing WordPress:

by Justin Ellingwood
WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MySQL backend with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and...
Have another answer? Share your knowledge.