Solved: PHP Fatal Error in Debug Mode Topic is solved

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
rjo
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Wed May 23, 2007 7:37 pm

Solved: PHP Fatal Error in Debug Mode

Post by rjo » Thu Sep 27, 2018 3:35 pm

Usually debug mode works fine (J! 3.8.12), but on a very (!) long list of (K2) articles I recently encountered a white screen with the following error log on the server:

Code: Select all

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 129805252 bytes) in .../plugins/system/debug/debug.php on line 347
Allocating more memory did not help.

Solution:
plugins/system/debug/debug.php on line 347 can be made more robust:
Replace...

Code: Select all

echo str_replace('</body>', implode('', $html) . '</body>', $contents);
...with...

Code: Select all

echo str_replace('</body>', '', $contents);
echo implode('', $html) . '</body>';
This is less compact but less memory consuming as well. With this fix it took quite some time to load the page, but the fatal error was gone.
Hope that helps someone,

Locked

Return to “Joomla! 3.x Bug Reporting”