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.
Simply deactivate and reinstall the theme / plugin in question to fix the error. However, it is also possible that WordPress is unable to locate the files because of a missing . htaccess file in your root folder.
The wp-config. php file is usually located in the root folder of your website with other folders like /wp-content/. Simply right click on the file and then select download from the menu. Your FTP client will now download wp-config.
The wp-config. php file is a configuration file created during the WordPress installation process. It stores database information such as the database name, username, password, and host. In addition to establishing a connection between your WordPress site and its database, WordPress also uses the wp-config.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With