Jomon Thomas Lobo
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Facing same issue .
PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted debug log has this errorForum: Developing with WordPress
In reply to: Error loggingIf you have set
WP_DEBUG
andWP_DEBUG_LOG
to true in your WordPresswp-config.php
file but you are not seeing the debug messages in the debug log file, there could be a few reasons for this behavior. Here are some steps you can take to troubleshoot and resolve the issue:- Check File Permissions:
Ensure that the directory where the debug log file is supposed to be written has the correct permissions that allow PHP to write to it. Typically, the file should be writable by the web server user (e.g.,www-data
on Apache). - Verify Debug Log Location:
WordPress debug logs are usually written towp-content/debug.log
unless you have explicitly defined a different location using theWP_DEBUG_LOG
constant. Double-check the location to ensure you are looking at the correct file. - Verify
wp-config.php
Changes:
Double-check yourwp-config.php
file to ensure that theWP_DEBUG
andWP_DEBUG_LOG
constants are set correctly. Make sure there are no typos or syntax errors in the file. - Check Error Reporting Level:
Ensure that your PHP error reporting level includes notices and warnings. If the errors you are trying to log are not severe enough, they may not appear in the debug log. You can set the error reporting level in yourphp.ini
file or in your WordPresswp-config.php
file usingerror_reporting(E_ALL);
. - Check for Output Buffering:
Output buffering can sometimes interfere with debug output. Make sure that there are no functions or settings in your code that are buffering output, which could prevent the debug messages from being written to the log file. - Test with Simple Debug Message:
Instead of usingerror_log('hello');
, try usingerror_log('hello', 0);
orerror_log('hello', 3, '/path/to/debug.log');
directly in your PHP code to see if any message gets logged. This can help isolate whether the issue is with theerror_log
function or with the debug settings. - Review Server Error Logs:
Check your server’s error logs (e.g., Apache error log, PHP error log) for any relevant messages or errors that might indicate why the debug messages are not being logged as expected.
By following these steps and checking these common issues, you should be able to diagnose why your
error_log
messages are not appearing in the WordPress debug log file. - Check File Permissions:
Viewing 2 replies - 1 through 2 (of 2 total)