I plan to configure ZendDebugger for debugging. After the configuration is completed for a long time, the configuration is not successful, and ZendDebugger does not take effect in phpinfo. It is found that it is a php5.3 problem and must be uninstalled first. This article describes how to use xdebug.
The software installation is too simple. Execute the following commands:
Sudo apt-get install apache2
Sudo apt-get install php5
Sudo apt-get install php5-cli
Sudo apt-get install php5-xdebug
Php configuration:
Php. ini contains three folders in/etc/php5/: apache2, cli, and conf. d. We should modify php under apache2 and cli. ini. in conf. d. There is an xdebug. the INI file records the xdebug file path.
Sudo vi/etc/php5/apache2/php. ini
Sudo vi/etc/php5/cli/php. ini
Use the superuser permission to open the above two php. ini, and add the following code:
[Xdebug]
Xdebug. remote_enable = 1
Xdebug_remote_host = "localhost"
Xdebug. remote_port = 9000
Xdebug. remote_handler = "dbgp"
Zend_extension =/usr/lib/php5/20090626 + lfs/xdebug. so
Restart apache: sudo/etc/init. d/apache2 restart
Configure the debugging and running environment of eclipse
Open the eclipse menu-[windows]-> [preferences]
Select php-debug and select xdebug from php debugger in the right window. The character set below is the same as the developed code character set and then applied.
Select "php executables" in the upper-right corner of the window. Name: php5; excute phth:/usr/bin/php5; ini file:/etc/php5/apache2/php. ini; type: cli; debugger: xdebug.
Now everything goes well, you can start the breakpoint debugging program.