[PHP] how to use xdebug to Debug php in NetBeans. In fact, the article focuses on how to configure the xdebug environment of php. after all, the environment is ready, such as the IDE such as NetBeans and Eclipse, any one can Debug php.
Operating Environment:
OS: Ubuntu 10.04
Server: xampp 1.7.3a
1. download xdebug. so
It is convenient for lazy people and does not need to compile, so a 32-bit xdebug. so is provided.
Http://download.csdn.net/source/2757538
After the file is downloaded, place the file (note that this is different from the path for installing xamp, which is a general installation path)
/Opt/lampp/lib/extensions
2. configure php. ini
Open/opt/lampp/etc/php. ini and add the following content:
Code
zend_extension =/ opt / lampp / lib / php / extensions / xdebug.so[debug]; Remote settingsxdebug.remote_autostart = offxdebug.remote_enable = onxdebug.remote_handler = dbgpxdebug.remote_mode = reqxdebug.remote_host = 127.0 . 0.1 xdebug.remote_port = 9000 ; Generalxdebug.auto_trace = offxdebug.collect_includes = onxdebug.collect_params = offxdebug.collect_return = offxdebug.default_enable = onxdebug.extended_info = 1 xdebug.manual_url = http: // www.php.netxdebug.show_local_vars = 0 xdebug.show_mem_delta = 0 xdebug.max_nesting_level = 100 ;xdebug.idekey = ; Trace optionsxdebug.trace_format = 0 xdebug.trace_output_dir =/ tmpxdebug.trace_options = 0 xdebug.trace_output_name = crc32; Profilingxdebug.profiler_append = 0 xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 0
3. remember to restart the server!
sudo / opt / lampp / lampp restart
4. open a project with NetBeans, add breakpoints, and debug!