PHP program Z xdebug Tool Brief use method

Source: Internet
Author: User

    • Debug of PHP Program

The debug of a PHP program, either CLI or Web, requires the use of a third-party debug tool. Prior to PHP5.6, the debug function itself was limited to log output.

It is recommended to use the free xdebug. Xdebug as a zend extension exists. It can be installed by phpize alone after the installation of PHP.

A few notes on the installation of Xdebug

    1. If you do not know what to download Xdebug version, can be here, by uploading phpinfo information, the system gives recommendations: http://xdebug.org/wizard.php
    2. After installation, you need to specify the xdebug.so mode in php.ini, which may vary depending on the PHP version. For details, see this: http://xdebug.org/docs/all#configure-php
    3. Make install if the installation is not successful, you can go to the Modules folder, manually copy xdebug.so to 1 under the suggested folder

A few notes on the use of Xdebug

    1. If you need to set breakpoints and single-step tracking, you can use the debugclient that comes with Xdebug. Located under the Debugclient folder. Installation method: Http://xdebug.org/docs/all#debugclient
    2. XDEBUG code tracking is done through remote debug; Debugclient is actually a server for listening and waiting for debug requests; All breakpoints are set through Debugclient. For detailed control commands, refer to: http://xdebug.org/docs-dbgp.php
    3. PHP uses debugclient as the server rather than the Java-like remote debug mode. The reason is that PHP code is not similar to Java compilation execution can directly see the source code, on the other hand, debugclient can be based on the session settings, to distinguish which requests need to debug and single-step tracking. This is very meaningful for multiple concurrent Web applications (of course, Java can also be implemented by setting conditional breakpoints). Reference: Http://xdebug.org/docs/all#activate_debugger
    4. For the CLI PHP program to debug, you need to set xdebug_config. Refer to: Http://stackoverflow.com/questions/13284795/setting-xdebug-breakpoints-solely-in-command-line

About GDB Debug PHP program, mainly for the Zend engine itself, PHP source code and extension of the Debug. This is why the PHP source comes with the gdb script. Gdbinit reason.

PHP program Z xdebug Tool Brief use method

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.