Go How to use the Xdebug tool in Phpstorm, entry-level operation method (pro-Test active)

Source: Internet
Author: User
Tags phpinfo

0 Preface

Online tried a lot of programs, some simply invalid, some valid for a period of time after failure, however this method is always effective, so showings record

1 Introduction

Phpstorm is a lightweight and convenient PHP IDE that provides smart code completion, fast navigation, and instant error checking, which greatly improves coding efficiency. Its unique development convenience, in a short period of time to win a large number of phper favor. 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. You can passThe debugger interactively debug scripts at the front and back ends. Phpstorm as a powerful ide,debug function naturally. This case only describes the most basic practical debug method. 2 Detailed Operation2.1 Preparation Phpstorm Version: 8.0.3PHP version: 5.5.12xdebug version: Php_xdebug-2.2.5-5.5-vc11.dll Note: The PHP version and the Xdebug version must correspond. I use the wampserver,php and Xdebug have been downloaded. Download the Xdebug URL separately for http://xdebug.org/download.php

2.2 Configuring PHP.ini


Locate the directory where php.ini is located, add the following text at the end of the file (if it already exists, leave the preceding semicolon; remove) zend_extension_ts= "D:/wamp/bin/php/php5.5.12/zend_ext/php_ Xdebug-2.2.5-5.5-vc11.dll "//xdebug storage path, xdebug.remote_enable=on//whether to allow remote terminal, this must be turned on xdebug.profiler_enable = Off// Performance optimization, this article does not use, select Off (do not close, will be about hundreds of m per minute to generate a large number of log files, not one day your hard drive on the cry) xdebug.idekey= "phpstorm";//here is the Debugger keyword save, restart the server. To see if Xdebug is successful, print phpinfo. Put the following code into any PHP file, and the browser can access it. <?php echo phpinfo ();?> 2.3 Configure Phpstorm drop-down Select Edit configurations, configure server information, add Project Debug Development address, click OK. The Phpstorm configuration is complete. Local server configuration Details View http://blog.csdn.net/knight_quan/article/details/51830683 2.4 Use the debug feature to make a breakpoint on the line that needs to be debugged (click on the blank space after the line number, One more time to cancel the breakpoint), it should be noted that when the program runs to the breakpoint, the program stays on the line, but the row itself does not execute. From there, you can see all the data information that the program contains when it runs here. Of course, the ability to view information is equivalent to using Echo,print or var_dump. Operation Flow: Break Point--click Bug-click Browser page Trigger breakpoint--auto jump back to phpstorm-> view carried data (for debugging purposes), you can follow the steps to find problem points, click Run (or F5) Debug complete with Browser page continue

3 Additional Instructions3.1 If the port is occupied, you can configure Xdebug.remote_port in php.ini with the same debug port in Phpstorm. PHP.ini: Xdebug.remote_port = 9000 Phpstorm: 4 Summary:Xdebug can be used to track, debug and analyze the health of PHP programs. This article is focused on debugging. Xdebug itself has a large number of built-in functions to analyze PHP program performance bottlenecks and other issues. The advanced usage methods are described in other articles. Flexible use of xdebug can help improve commissioning efficiency. (

Log down for easy backup)

5 References

How to use the Xdebug tool in 1.PhpStorm, entry-level operation method

Go How to use the Xdebug tool in Phpstorm, entry-level operation method (pro-Test active)

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.