Install Xdebug and configure the PHP plugin

Source: Internet
Author: User
Installation:

In order to better debug PHP program, install Xdebug. Official website: http://www.xdebug.org first download xdebug-2.4.0rc3.tgz, download the source code on the official homepage, Download back the file name is: Xdebug-2.4.0rc3.tgzxdebug version should be corresponding to your PHP version, since my PHP is 5.6.11, so i download xdebug-2.4.0rc3.tgz#cd/your/download/ Path#tar ZXVFXDEBUG-2.4.0RC3.TGZCD XDEBUG-2.4.0RC3 Run phpize#phpize here do not need--prefix, compiled after the modules files directly copied away. #./configure--enable-xdebug#make I copied the xdebug.so to my PHP installation directory, I loaded PHP with the installation directory specified, so I copied it to/home/developer/opt/php/ In the 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. #cp Modules/xdebug.so/home/developer/opt/php/xdebug Add the following line to the end of your 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 in:/usr/local/etc/php.ini#vim/usr/local/etc/php.ini Add the following line: zend_extension= "/home/developer/opt/php/xdebug/ Xdebug.so "Note that if you have installed Zend Optimizer then, note that there is zend_extension= in your php.ini file, if it already exists, please comment it out, add it before 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.



Configuration xdebug:

[Xdebug]zend_extension              = "/home/developer/opt/php/xdebug/xdebug.so"; Allow remote IDE debug xdebug.remote_enable        = on; Remote host Xdebug.remote_host          = 192.168.231.57xdebug.remote_port          = 9000; default port 9000xdebug.idekey               = "Phpstorm" Xdebug.profiler_enable      = on; temporary trace information output xdebug.trace_output_dir     = "/tmp/xdebug_logs/trace" Xdebug.profiler_ Output_dir  = "/tmp/xdebug_logs/profiler"; other parameters; Turn on auto-tracking. Automatically turns on the "monitor function call process" mode. This function can output the monitoring information of a function call as a file in the directory you specify Xdebug.auto_trace           = on; Turn on exception tracking xdebug.show_exception_trace = on; Turn on remote debugging auto start Xdebug.remote_autostart     = on; collect variable xdebug.collect_vars         = on; collect return value xdebug.collect_return       = On ; collect parameter Xdebug.collect_params       = on; show local variable xdebug.show_local_vars      = on; display default error message xdebug.default_enable       = on; application-layer communication protocol for Zend Studio remote debugging Xdebug.remote_handler       = DBGP; if it is set too small, there will be more recursive calls to itself in the function than the maximum number of nested errors Xdebug.max_ Nesting_level    = 10000
  • 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.