Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 575
Sai Prashanth Avatar asked Jan 16 '17 03:01

Sai Prashanth


People also ask

How do I fix WordPress failed to open stream error?

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.

How do I open WP-config php?

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.

What can you do with WP-config php?

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.


1 Answers

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

like image 129
Lakshmi Avatar answered Oct 22 '22 07:10

Lakshmi