Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When do changes to wp-config.php take effect?

Tags:

wordpress

I am trying to enable debugging on a WordPress site to debug a plugin. I read about the WP_DEBUG setting and I added the following to my wp-config.php file:

define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); 

My understanding is that I should see a debug.log file in my wp-content directory. I haven't seen anything yet, but I don't know if that is because there aren't any errors that have been logged, or if something needs to be restarted for these settings to take effect. So my question is when are the wp-config.php settings read and do I need to restart any services to make changes take effect.

like image 328
Gabriel Southern Avatar asked Jul 22 '12 19:07

Gabriel Southern


People also ask

How do I update my WP-config php file?

Simply right click on the file and then select download from the menu. Your FTP client will now download wp-config. php file to your computer. You can open and edit it using a plain text editor program like Notepad or Text Edit.

How do I use WP-config changes?

Using File Manager from cPanel to Access wp-config Select the site you are editing. Once you are in the website's root directory, click wp-config once to highlight it. Click the “Download” function from the top tool bar to make a backup copy. Save it somewhere that will be easy to find later if you need it.

What does WP-config php do?

wp-config. php is one of the core WordPress files. It contains information about the database, including the name, host (typically localhost), username, and password. This information allows WordPress to communicate with the database to store and retrieve data (e.g. Posts, Users, Settings, etc).

What happens if I delete WP-config php?

php file, which contains all the site's database credentials and its salts, along with any constants being used. Remember not to delete the wp-config. php file in the html folder of your site server. This will cause the site not to load, as the database will not be able to connect for your child site.


1 Answers

"Changes" to wp-config.php take place right away when edited by FTP or via the shell, because that file is accessed each time any page is generated and output by WordPress. No reboot of the server is needed; just do a load or a refresh of any front or backend page of the WordPress site.

Do something to trigger a php error, like removing a bracket from a php function in header.php of the theme and see if that gets logged in debug.log. Check for the error in debug.log in wp-content.

If the file doesn't exist, there may be permission problems and WordPress couldn't create the file. So add a plain text file (with the correct text encoding for your system; it's best to use the FTP client to create a few file) and title it debug.log. If you create the file locally and upload it, give it at least 755 permissions, but 644 is safer. Then invoke a php error again and see if it gets logged.

like image 84
markratledge Avatar answered Sep 22 '22 03:09

markratledge