Append xdebug trace to script output
It possible to analyze xdebug traces with different tools, but sometimes you want to see it online. Lets create xdebug.yourdomain.com virtualhost, which will render the same page as yourdomain.com, but will add xdebug trace to the end.
Copy yourdomain.com virtualhost config, change ServerName and add these two lines to it:
php_admin_value auto_prepend_file /etc/php5/xdebug_prepend.php php_admin_value auto_append_file /etc/php5/xdebug_append.php |
Create /etc/php5/xdebug_prepend.php:
<?php ini_set('xdebug.auto_trace', 'On'); ini_set('xdebug.trace_output_name', 'trace.%r'); ini_set('xdebug.trace_format', '2'); xdebug_start_trace(); ?> |
Also create /etc/php5/xdebug_append.php:
<?php echo file_get_contents(xdebug_get_tracefile_name()); xdebug_stop_trace(); ?> |
Restart apache, and go to xdebug.yourdomain.com. You will be able to see xdebug trace at the end of page.
Leave a Reply
You must be logged in to post a comment.