Phpstorm and xdebug are used for remote debugging.

Source: Internet
Author: User
Phpstorm and xdebug are used for remote debugging. Phpstorm and xdebug are used for remote debugging. the resumable debugging function of phpstormxdebugvs is powerful and can be used to view all variables. Php debugging is troublesome. echo: phpstorm and xdebug are used to implement remote debugging. phpstormxdebug

The breakpoint debugging function of vs is very powerful, and all variables can be viewed. Php debugging is very troublesome. you may have to say echo or var_dump. Would you like to experience the pleasure of ide debugging? Use xdebug.

1. principle:Xdebug is a php debugging plug-in that supports remote debugging. when the php file is running, the debugging information can be sent to the remote port through the tcp protocol. when the ide receives the debugging information, you can send xdebug commands such as One-Step running, stop running, and run. In this way, powerful debugging functions such as vs are implemented.

2. required stuff:An ide that supports remote debugging of xdebug. phpstorm is a powerful phpide. In addition, you need an xdebug for your php version.

3. steps:Download xdebug first. please download the xdebug corresponding to your php version on the official website.

If you do not know your version, please echo phpinfo (); haha, then copy the entire page to the box on the page of the http://xdebug.org/wizard.php, then he will automatically analyze your php version, then, tell you which folder you want to put it in. we can just put it in the php Extension folder. I am D: \ xampp \ php \ ext.

Configure php. ini and add the following at the end:

[xdebug]zend_extension = D:\xampp\php\ext\php_xdebug-2.2.0-5.3-vc9.dllxdebug.remote_enable=1xdebug.remote_host=127.0.0.1xdebug.remote_port=9000xdebug.idekey=phpstorm4xdebug.remote_autostart=1

To explain, the first line is to load xdebug, and romote_enable is to enable remote debugging. below is the remote debugging parameters, ip addresses, ports, recognition strings, and automatic remote debugging.

Restart apache and load xdebug successfully. it will be much slower for Shenma website. because you have enabled automatic remote debugging, each access will connect to the defined ip address and port. Haha. Let's make a choice.

Then configure the ide,

Select editconfig and configure it as follows:

Configure the server 127.0.0.1 80 xdebug in php remote debug, and set the recognition string. Here we have defined phpstorm4 and saved it. In this way, the configuration is complete.

4. use: now we can start debugging.

Click to start remote debugging. if it turns green, the listener is successful. Next we will set a breakpoint.

We can see that there are wood, wood, and wood. it is very powerful. you can execute it step by step. F7 is a single-step function, and F8 is a single-step skip function. Leave a message that you do not understand.

Articles you may be interested in:
  • Resolve phpstorm + xdebug remote breakpoint debugging
  • Phpstorm configuration Xdebug debugging PHP Tutorial
  • How to configure Xdebug in PHPStorm
  • Php + phpStorm + xdebug configuration method

The breakpoint debugging function of Visual Studio is very powerful. you can view all the variables. Php debugging is troublesome, such as echo ,...

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.