Debugging WordPress
-
Hello All!
I'm fairly certain I'm just missing something -- but I'm having issues debugging WordPress. I'm having an issue with Elementor and need to see any WordPress / PHP errors. I've changed the following in wp-config.php and restarted the app to no avail. The debug log doesn't seem to be created or logging in /wp-content/debug.log.define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false);
Any help with this would be greatly appreciated!
Thank you!
-
In addition to what @murgero said, you can also put things in
/run/debug.log
or/tmp/debug.log
as well. Note that the files under /tmp are cleaned up automatically periodically, so this can either be a plus or minus depending on your use case. -
@murgero Thank you! I gave that a shot, but it still doesn't seem to be working. I am using the "WordPress Developer)" app -- but can migrate this over to a LAMP Stack, if needed.
@girish Thank you! I'll give the
/run/debug.log
option a shot. I'd like to be able to view them as needed, rather than having it stored in the/tmp/
directory. -
@jlx89 said in Debugging WordPress:
I am using the "WordPress Developer)" app -- but can migrate this over to a LAMP Stack, if needed.
The WP Developer app is essentially the same.
I quickly tried this out. I blindly put the defines you posted at the end of file and it did not work as well :-). It turns out, this was because in
wp-config.php
, those constants are already defined. In around lines 75-77:define( 'WP_DEBUG', false ); define( 'WP_DEBUG_LOG', false ); define( 'WP_DEBUG_DISPLAY', false );
I had to remove those duplicate lines, since I guess PHP does not allow re-defining constants.
After removing them, I added some junk in
headers.php
likerandom_function();
and I see that debug.log is created once I visit WP. -
-
-
@jlx89 I setup a test here - https://my.demo.cloudron.io/#/app/cc6803b8-c862-4a2b-8c12-e25c9a092592 . I put a bad func call here - https://my.demo.cloudron.io/filemanager.html?type=app&id=cc6803b8-c862-4a2b-8c12-e25c9a092592#public/wp-includes/functions.php . Maybe you can check what is different...
-
@girish So I replicated what you had done in the demo. So that seems to be working now -- after I disabled the plugins we have installed. I'm going to work through and go one-by-one on the plugins and see what is going on. This seems to be a really odd issue.