Administrator
- Join Date:
- Sep 2009
- Location:
- Stuart, FL
- Posts:
- 14,099
- Plugin Contributions:
- 56
myDEBUG Backtrace [Support Thread]
My, my! That was fast ... v1.0.2 is now available for download!
Views: 8,702
Administrator
My, my! That was fast ... v1.0.2 is now available for download!
Totally Zenned
lat9:
My, my! That was fast ... v1.0.2 is now available for download!
That's 'cause you got JUICE.. (pays to be behind the velvet rope!!:laugh:)
Zen Follower
Hi,
i got a strange report:
[25-May-2015 14:59:07] PHP Warning: debug_print_backtrace() expects exactly 0 parameters, 1 given in /var/www/vhosts/.../httpdocs/includes/extra_configures/enable_error_logging.php on line 20
It should report something different instead of that, right?
In every debug file is the same regerdless the error reported after.
I checked the plugin file and it should be installed correctly... What am i missing?
Administrator
@izar74: You're running on a PHP version less than 5.3.6, right?
Zen Follower
lat9:
@izar74: You're running on a PHP version less than 5.3.6, right?
ops, forgot to add the server configuration...
Yes, the server is actually using PHP: 5.3.3, is that the problem?
Administrator
Well... it's the reason! The parameter was introduced in PHP 5.3.6.
You can edit the /includes/extra_configures/enable_error_logging.php file and its admin counterpart, changing the line that reads:
debug_print_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS);
to
debug_print_backtrace ();
Zen Follower
lat9:
Well... it's the reason! The parameter was introduced in PHP 5.3.6.
You can edit the /includes/extra_configures/enable_error_logging.php file and its admin counterpart, changing the line that reads:
debug_print_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS);
> to
> ```
debug_print_backtrace ();
Thanks a lot :-)
Administrator
I've submitted v1.0.3. This version calls the debug_print_backtrace function with arguments dependent on the PHP version ... so no more PHP warnings for PHP versions less than 5.3.6 (which are no longer supported, anyway).
If you're currently using the plugin on a later version of PHP, there is no need to update.
Administrator
v1.0.3 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=1879
Administrator
I just submitted v1.1.0 for review. The information logged now contains the REQUEST_URI (actual page and parameters) and REMOTE_ADDR (the IP address) values active when the debug-log occurred.
There have been times when an issue occurs *only *on a specific page's access and/or when a specific IP address is accessing (like a script kiddie forcing out-of-memory conditions), so that additional information will help in figuring out what's going on when a debug-log occurs.
Administrator
v1.1.0 is now available for download.
Administrator
Note: Starting with Zen Cart v1.5.5, the functionality provided by this plugin is included in the Zen Cart core, thus rendering this plugin obsolete for that and later Zen Cart versions.
Totally Zenned
lat9:
Note: Starting with Zen Cart v1.5.5, the functionality provided by this plugin is included in the Zen Cart core, thus rendering this plugin obsolete for that and later Zen Cart versions.
Well, as a "plugin" it was great while it lasted. Now it shall live on to continue helping to solve problems. :)
Totally Zenned
Can this plugin be installed with 'Display logs' plugin?
Administrator
adb34:
Can this plugin be installed with 'Display logs' plugin?
Yes, they're independent of one another.
Totally Zenned
lat9:
Yes, they're independent of one another.
Thank you
Zen Follower
I'm trying to debug an error that comes up occasionally on login but this add-on doesn't seem to work. Is there a class of php errors that this add-on does not provide a backtrace? I'm seeing just the following in the log file:
[13-Mar-2016 18:05:52 Europe/Berlin] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 268814123 bytes) in /Applications/MAMP/htdocs/Costore_trunk/includes/functions/html_output.php on line 62
(And yes, I've looked for stray spaces at the beginning and end of php files.) Why doesn't the backtrace work?
zen cart 1.5.1, modified with numerous add-ons and custom code. Local development system, MAMP 3.2.1, PHP 5.6.7.
Thanks,
Dave
Administrator
The backtrace doesn't work because of the nature of the error: PHP Fatal errors are not backtraceable.
What you've run into, however, is previously reported in a bugfix for Zen Cart v1.5.1 (when running on versions of PHP > 5.4.12): https://www.zen-cart.com/showthread.php?207435-php-5-4-fatal-error-Allowed-memory-size-of-83886080-bytes-exhausted&p=1240514#post1240514
Zen Follower
Thanks lat9! I had forgotten about that bugfix which I had applied to one of my development sites but not the other. Will the change in the html_output.php files adversely affect operations if the server is running 5.3.x? (The live site is running 5.3.28)
Dave
Administrator
@Dave224: That change is downwardly-compatible with PHP 5.3.x.
Tell staff why this post should be reviewed.