debugging breakpoints in software development is essential, here is the Debug configuration of PHP in the Eclipse tool in ubuntu10.04.
This plan to configure Zenddebugger for debugging, configuration of the old long time not configured successfully, in phpinfo see Zenddebugger effective, after the discovery is php5.3 problem, must first uninstall, this article introduced the use of Xdebug.
The software installation is too simple, the following commands are executed separately:
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install php5-cli
sudo apt-get install Php5-xdebug
Configuration of PHP:
PHP.ini in a few folders under/etc/php5/, there should be three folders: Apache2, CLI, CONF.D, we should modify apache2 and the CLI under PHP.ini. Under CONF.D, there is a Xdebug.ini file that records the path of the Xdebug file.
sudo vi/etc/php5/apache2/php.ini
sudo vi/etc/php5/cli/php.ini
Open the above mentioned two php.ini with Superuser privileges, 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
Configuring the Debug and run environment for Eclipse
Open Eclipse's Menu-[windows]->[preferences]
Select Php-debug in the right window of PHP debugger select Xdebug, the following character set selection is consistent with the code character set developed, and then applied.
Select PHP Executables window to the right of the new, name: Php5;excute Phth:/usr/bin/php5;ini file:/etc/php5/apache2/ Php.ini;type:cli;debugger:xdebug.
OK, now that everything goes well, you can start the breakpoint debugging program.