Home >Backend Development >PHP Problem >Is xdebug useful in php?
xdebug is useful in php. Xdebug is an open source PHP program debugger (i.e. a Debug tool) that can be used to track, debug and analyze the running status of PHP programs.
php xdebug is useful.
Xdebug is an open source PHP program debugger (i.e. A Debug tool) that can be used to track, debug and analyze the running status of PHP programs.
The latest version of Xdebug in 2018 is Xdebug 2.7.0beta1, release date 2018-09-20, adding support for PHP7.2.
Installation
Download xdebug
There are two versions with Non-thread-safe and without Non-thread-safe, mainly Check whether your php version is thread-safe.
Then copy it to the ext directory under your php,
Modify php.ini and add the following information:
[Xdebug]
zend_extension= "x:\PHP\ext\php_xdebug-2.0.5-5.2.dll"
;The following are the parameters
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
xdebug.trace_output_dir=”x:\Temp”
xdebug.profiler_enable=on
xdebug.profiler_output_dir=”x :\Temp”
;x is your drive letter
parameter settings
xdebug.default_enable=on
;display Default error message
xdebug.auto_trace=on
;Automatically turns on the "monitoring function call process" function mode. This function can output the monitoring information of function calls in the form of a file in the directory you specify. The default value of this configuration item is off.
xdebug.collect_params=on
;Turn on the function of collecting "function parameters". Include the parameter values of the function call in the monitoring information of the function procedure call. The default value of this configuration item is off.
xdebug.collect_return=on
;Turn on the function of collecting "function return values". Include the return value of the function in the monitoring information of the function procedure call. The default value of this configuration item is off.
xdebug.max_nesting_level=100
xdebug.profiler_enable=on
;Open the performance monitor.
xdebug.remote_enable=on
;Whether to debug
xdebug.remote_host=localhost
xdebug.remote_port=9000
;Debug Port
xdebug.remote_handler=dbgp
;Select protocol
xdebug.trace_output_dir="d:\Temp"
;Set function call monitoring information The path to the output file.
xdebug.profiler_output_dir="d:\Temp"
;Set the path to the performance monitoring information output file.
After setting the parameters, restart the server and use the phpinfo() function to check whether there is an xdebug project and whether the installation is successful.
The detailed configuration parameter options are as follows:
##Recommended tutorial: "php tutorial》
The above is the detailed content of Is xdebug useful in php?. For more information, please follow other related articles on the PHP Chinese website!