Linux under xdebug debug PHP Blog Category: phpphplinuxzendeclipsec# in order to debug PHP program, install Xdebug. Official website: http://www.xdebug.org First download xdebug2.1.0, In the official homepage to download the source code, download back the file name is: Xdebug-2.1.0.tgzxdebug version should correspond to your PHP version, since my PHP is 5.3.2, so download xdebug2.1.0 XML code Collection code cd/your/ Download/path tar zxvf xdebug-2.1.0.tgz cd xdebug-2.1.0 run Phpizexml Code Collection code phpize If you do not add phpize to $path, you should use the full path here Do not need to--prefix, compile and then directly modules in the xdebug.so files copied away. The XML code collection code./configure--enable-xdebug--with-php-config=/usr/local/php/bin/php-config XML code Collection code make xdebug.so complex To the PHP installation directory, when loaded with PHP to specify the installation directory, so copy into the/usr/local/php/xdebug. You can copy anywhere you want, as long as you know well. You need to change the path of the following command to your own. The XML code collection code CP modules/xdebug.so/usr/local/php/xdebug adds the following line to the end of the php.ini file. If you have defined the location of the php.ini, be sure to find the location oh, it is recommended to get a phpinfo (), to see the exact location of the php.ini file. My position is:/usr/local/etc/php.ini Add the following: XML code collection code [Xdebug] zend_extension = "/usr/local/php5/xdebug/xdebug.so" Xdebug.profiler_enable=on xdebug.trace_output_dir= "/usr/local/php5/xdebug/" xdebug.profiler_output_dir= "/usr/ local/php5/xdebug/"Xdebug.remote_eNable=on XDEBUG.REMOTE_HANDLER=DBGP; xdebug.remote_host=localhost xdebug.remote_port=9999 notice, as If you have installed Zend Optimizer then, notice whether there is a zend_extension= in your php.ini file, if it already exists, please comment it out, add it before the zend_extension=; , example:; zend_extension= "/usr/local/lib/php/20060613/zendextensionmanager.so" In this way, the Xdebug can be installed and run properly. Restart your Web server. Next Open the Phpinfo () to see if there is xdebug information in it. This program makes use of the Zend Scripting Language engine:zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies With Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans may encounter problems 1.Cannot find Autoconf/usr/local/php/bin/phpize Hint XML code collection code configuring for:php API version:20041225 Zend Module API no:20060613 Zend Extension API No : 220060519 cannot find autoconf. Please check your autoconf installation and the $PHP _autoconf environment variable are set correctly and then rerun this s Cript. The source code directory also does not generate configure need to install two package XML code collection code imake-1.0.2-3.i386.rpm autoconf-2.59-12.noarch.rpm 2.CONFIGURE:ERROR:CANnot find Php-configxml Code Collection code./configure--with-php-config=/usr/local/php/bin/php-config # here if executed directly. Configure is likely to get an error # "Configure:error:Cannot find Php-config. Please use--with-php-config=path ", # your profile location may not be in this directory, this file is usually in the PHP installation directory of the bin directory under a file name is called Php-config or php-config5 files, I can't find it.
Debug PHP with Xdebug under Linux