I personally think that for experienced programmers, using functions such as echo, print_r (), print_f (), and var_dump () is sufficient to Debug php code. if you do not like this, xdebug is a very good php debugging tool.
I personally think that for experienced programmers, using functions such as echo, print_r (), print_f (), and var_dump () is sufficient to Debug php code. if you do not like this, xdebug is a very good php debugging tool.
The installation tutorial is as follows:
1. first download the corresponding php_xdebug.dll ,:
Http://www.xdebug.org/download.php
2. copy the downloaded file to the ext directory in your php file.
3. edit the php. ini file and add the following information:
[Xdebug]
Zend_extension = D: \ xampp \ php \ ext \ php_xdebug.dll (Win)
Xdebug. profiler_enable = on
Xdebug. trace_output_dir = "../Projects/xdebug"
Xdebug. profiler_output_dir = "../Projects/xdebug"
The directory "../Projects/xdebug" after you want to place the Directory of the data file output by Xdebug, which can be set freely.
Parameter reference settings:
Xdebug. default_enable = on
; Displays the default error message
Xdebug. auto_trace = on
Automatically enable the "Monitor function call process" module. This function outputs the monitoring information of function calls in a file in the specified directory. The default value of this configuration item is off.
Xdebug. collect_params = on
To enable the function of collecting "function parameters. Include the parameter values of function calls in the monitoring information of function process calls. The default value of this configuration item is off.
Xdebug. collect_return = on
; Enable the function to collect "function return values. Include the return value of a function in the monitoring information of function call. The default value of this configuration item is off.
Xdebug. max_nesting_level = 100
Xdebug. profiler_enable = on
; Enable the Performance Monitor.
Xdebug. remote_enable = on
; Debugging or not
Xdebug. remote_host = localhost
Xdebug. remote_port = 9000
; Debug port
Xdebug. remote_handler = dbgp
; Select protocol
Xdebug. trace_output_dir = "d: \ Temp"
Set the path of the output file of the function call monitoring information.
Xdebug. profiler_output_dir = "d: \ Temp"
Set the path of the output file of performance monitoring information.
Now, the installation is complete. View:
Let's take a look at the debugging results. just try the wrong php code:
The following error message is displayed during access: