How to install and configure Xdebug under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.