How to install and configure Xdebug under Linux
Xdebug is an open source PHP program debugger (a debug tool) that can be used to track, debug, and analyze the health of PHP programs.
This article is to explain in Linux under the Xdebug installation and configuration method, interested students reference.
Xdebug Introduction
Xdebug is an open source PHP program debugger (a debug tool) that can be used to track, debug, and analyze the health of PHP programs.
Xdebug Installation
First let PHP error display, only need to modify the php.ini of the 2 instructions, the displayerrors and Htmlerrors are set to ON, as shown below
Html_errors = On
Display_errors = On
Of course if you need to see more information, such as printing the call stack, you need to install Xdebug, which is especially helpful for more complex code systems.
Xdebug is a module of PHP, need to compile the installation, I use LNMP installed php,php is installed by default to/usr/local/php, and then do a hard link to/usr/bin
Compile Xdebug First
Download Xdebug wget http://www.xdebug.org/files/xdebug-2.2.3.tgz
and start compiling.
Tar xzf xdebug-2.2.3.tgz
CD xdebug-2.2.3
/usr/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
Make
Make Test
Here I have a problem is to open Proc_open in the php.ini file
Make install
Compile finish Next Modify the php.ini configuration, you can first go to your PHP installation path under the Lib library directory to see if the xdebug.so file is generated, if it is generated, add the following to the php.ini file
no-debug-non-zts-20090626 this folder name and PHP version are one by one corresponding
extension= xdebug.so
Xdebug.profiler_enable = On
Xdebug.default_enable = On
Xdebug.trace_output_dir= "/tmp/xdebug"
Xdebug.trace_output_name = trace.%c.%p
Xdebug.profiler_output_dir= "/tmp/xdebug"
Xdebug.profiler_output_name= "cachegrind.out.%s"
Restart PHP-FPM, write the wrong PHP code, refresh the browser, you can see the error prompt.
How to install and configure Xdebug under Linux