Install and configure the PHP debugging tool Xdebug under ubuntu12.04

Source: Internet
Author: User
1. install Xdebug use command line installation: sudoapt-getinstallphp-pearsudoapt-getinstallphp5-devsudopeclinstallxdebug compilation installation download the corresponding xdebug source code installation package from here: http://pecl.php.net/pa 1. install Xdebug

Use command line installation:

sudo apt-get install php-pearsudo apt-get install php5-devsudo pecl install xdebug

Compile and install

Download the corresponding xdebug source code installation package from here: http://pecl.php.net/package/xdebug

Decompress the tgz file to the specified directory.

cd /path/to/xdebugphpize./configure --with-php-config=/usr/local/php/bin/php-configmakesudo make install
2. configuration

After the installation is complete, add the following line to php. ini:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"

Note: After zend_extension, you must keep up with the full path of xdebug. so. Otherwise, an exception occurs:

Failed loading xdebug.so: ?xdebug.so: cannot open shared object file: No such file or directory

The following are some settings for Xdebug.

[Xdebug]xdebug.default_enable = Onxdebug.show_exception_trace = Onxdebug.show_local_vars = 1xdebug.max_nesting_level = 50xdebug.var_display_max_depth = 6xdebug.dump_once = Onxdebug.dump_globals = Onxdebug.dump_undefined = Onxdebug.dump.REQUEST = *xdebug.dump.SERVER = REQUEST_METHOD,REQUEST_URI,HTTP_USER_AGENTxdebug.auto_trace=Onxdebug.collect_params=Onxdebug.collect_return=Onxdebug.trace_output_dir="/tmp/xdebug"xdebug.profiler_enable=Onxdebug.profiler_output_dir="/tmp/xdebug"

Restart apache.

If you want to determine whether the installation is successful, you can view it through phpinfo:

If you can see the preceding information, the installation is successful.

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.