12
votes

I am creating an Wordpress app server on apache and I am getting an error 500 while going to the url.So, I did check the httpd/logs/error_log and the following is the error

[Sun Jan 15 22:42:54.440349 2017] [:error] [pid 767] [client 10.203.116.148:9173] 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 Jan 15 22:42:54.440406 2017] [:error] [pid 767] [client 10.203.116.148:9173] PHP Fatal error: require_once(): Failed opening required '/var/www/html/wp-config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/wp-load.php on line 37

I tried changing the file permissions for Wp-config.php but no luck, is there anything else I could do.

2
Permission denied means just thatuser6763587
This means that the webserver user does not have permission to open the file either by being owner of it or being assigned to the user group that owns it. Permissions should be 644 or 755.Chris
so just using chown -a -G apache will it do it @ChrisSai Prashanth
Im not that great with linux commands so if thats going to change the user and group to the apache user and group then yes it should solve it. My apache user is www-data thoughChris

2 Answers

16
votes

Try changing file permissions of wp-config.php it might be given 640. Change file permission of wp-config.php or .htaccess file to 644.

Changing file permission of wp-config.php to 644 worked for me

0
votes

cheek the path on wp-load.php or post it here

.