For the same question, what is the approximate operation procedure? Or is there any related information? Thank you. For the same question, what is the approximate operation procedure? Or is there any related information? Thank you.
Reply content:
For the same question, what is the approximate operation procedure? Or is there any related information? Thank you.
If you have any questions, clear them.
As I said downstairs, PHP does not output the error stack, but it can still get the error stack through functions.
function getBacktrace() { ob_start(); debug_print_backtrace(); return ob_get_clean();}
Call the above function to get the error stack and use it againfile_put_contents('log_path', FILE_APPEND);
Write the log file.
There is another way: install xdebug extension for PHP
Installation method under windows: http://www.cnblogs.com/qiantuwuliang/archive/2011/01/23/1942382.html
After installation, modify php. ini
log_errors = Onerror_log = "F://path/php_error.log"
When PHP logs are enabled, only the logs generated when PHP errors occur, such as syntax errors and warnings. @ Mongobj wants to log in the service and quickly locate the location where the error occurred in the framework. If you don't need a framework, you need to combine PHP exception handling and log class libraries to implement such a function. if you use the framework, almost all the full stack frameworks will support it.
You can checkdebug-backtrace
Anddebug-print-backtrace.php
Two functions: http://www.php.net/manual/en/function.debug-backtrace.phphttp://www.php.net/manual/en/function.debug-print-backtrace.php