compiler installation and configuration instructions for PHP xdebug

Source: Internet
Author: User
Tags zts
Today, a PHP niche asked me php xdebug extension of the problem, and then re-write this note, in fact, this installation configuration is very simple, taking into account the understanding of the novice, equipped with text more detailed and practical simulation operation steps, Daniel slightly can

First open the Linux terminal to execute the command git clone git://github.com/xdebug/xdebug.git download the xdebug extension package, such as: (Please install git first without git)


Then execute the following command to switch to the Xdebug file package directory
[Happy@localhost www]$ CD Xdebug
Execute the phpize command in the Xdebug directory (specifically replaced with the path of the Phpize file under your actual PHP installation path)
[Happy@localhost xdebug]$/usr/local/php/bin/phpize (Execution results can be seen in PHP version date, etc.)

Compiling the Xdebug expansion pack
[Happy@localhost xdebug]$./configure--with-php-config=/usr/local/php/bin/php-config
[Happy@localhost xdebug]$ make (the following message indicates make succeeded)

Then perform the last step make install to complete the installation
[Happy@localhost xdebug]$ make install
Appears indicating successful installation and showing the location of the directory where the PHP extension is located

View the extended directory at this time to see that the xdebug.so extension file is installed in the PHP extensions directory

Configuring the php.ini file to join the Xdebug extension
[Xdebug]
zend_extension= "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
Xdebug.remote_enable = True
Xdebug.remote_host = localhost
#default Port 9000
#xdebug. Remote_port = 9000
Xdebug.profiler_enable = On
Xdebug.trace_output_dir = "/var/www/phpxdebug"
Xdebug.profiler_output_dir = "/var/www/phpxdebug"
Xdebug.auto_trace = On
Xdebug.show_exception_trace = On
Xdebug.remote_autostart = On
Xdebug.collect_vars = On
Xdebug.collect_return = On
Xdebug.remote_handler =DBGP
Xdebug.max_nesting_level = 10000
After the php.ini configuration parameter is modified, call the Phpinfo () function in the PHP page to see the extended information and related parameter options in the page Xdebug, and here's my settings:

php xdebug parameter description (for more questions, see the log for Xdebug before picking up stars )

Zend_extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so" #加载扩展文件xdebug. Remote _enable = Truexdebug.remote_host = Localhost#xdebug.remote_port = 9000 #默认端口 9000xdebug.profiler_e nable = Onxdebug.trace_output_dir = "/var/www/phpxdebug" Xdebug.profiler_output_dir = "/var/www/phpxdebug" #其余参数 # Open Start Auto Trace Xdebug.auto_trace = on# turn on exception trace Xdebug.show_exception_trace = on# turn on remote debugging auto Start Xdebug.remote_autostart = on# Collection Variable xdebug.collect_vars = on# Collect return value Xdebug.collect_return = on# application-layer communication protocol for Zend Studio remote debugging Xdebug.remote_handler =dbgp# If set too small, the function has recursive call itself too many times will be reported more than the maximum number of nested errors Xdebug.max_nesting_level = 10000
Zend_extension              = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
Xdebug loading method, different system and PHP version have different wording Linux and Mac OS X : zend_extension = "/usr/local/php/lib/php/extensions/ No-debug-non-zts-20121212/xdebug.so "
Windows version thread-safe php : zend_extension_ts = "D:\php\ext\xdebug.dll" version of Windows Non-thread-safe PHP : zend_ Extension = "D:\php\ext\xdebug.dll" So the same server can only load a debugging tool, either Zend Debugger or xdebug but test in PHP5.5 environment, Thread-safe version of PHP is not Can add _ts can only be written zend_extension = Xdebug.remote_enable = True allows remote IDE debug xdebug.profiler_enable = On and later directory "/var/www/phpxdebug" function is to turn on the execution of the analysis file to the specified directory functions, can be set freely. can also not sketch a file, for example, cachegrind.out.4408 This format named file, with the editor open can see a lot of programs run the relevant details
  • Related Article

    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.