Phpstorm configuration Xdebug debugging PHP Tutorial

Source: Internet
Author: User
This article mainly introduces how to use phpstorm + Xdebug to Debug PHP. For more information, see Running environment:

PHPSTORM version: 8.0.1

PHP version: 5.6.2

Xdebug version: php_xdebug-2.2.5-5.6-vc11-x86_64.dll

Ps: php and xdebug versions must correspond to each other

1. install xdebug extension in PHP

For php. ini configuration, the following configuration is for reference only, and the path should be replaced with your own!

[Xdebug]

Zend_extension = "D: \ wamp \ php-5.6.2-x64 \ ext \ php_xdebug-2.2.5-5.6-vc11-x86_64.dll"

Xdebug. remote_enable = On

Xdebug. remote_handler = dbgp

Xdebug. remote_host = localhost

Xdebug. remote_port = 9000

Xdebug. idekey = PHPSTORM

Ps: remote_handler, remote_host, and remote_port all have default values. However, we recommend that you set these parameters at least ~

View phpinfo ~

2. PHPSTORM settings

The landlord used zendstudio all the time. it was very painful to use phpstorm at the beginning. after using it for a while, I found it quite useful ~

1. check the xdebug configuration of phpstorm.

The debug port here must be consistent with xdebug. remote_port in php. ini! The default value is 9000. if Port 9000 is occupied, you can change it to another port.

2. set debug.

Add a local web server ~

Www.51open. pcom is my local web server ~ ~

3. start debugging

Set the first breakpoint and shift + F9.

Set the first breakpoint, select the debug configuration, and press the bug button next to it.

Summary:

Based on the breakpoint configuration, or when the Debug URL is enabled, or after the POST, if PhpStorm listens to the Debug connection, it will immediately switch to the editor interface and jump to the breakpoint, the browser will wait for PhpStorm operations.

You can interrupt PhpStorm debugging at any time, or conveniently perform Step Into/Step Over/Run to cursor (this crash occurs ):

Oh, I don't want to debug it, but PhpStorm always jumps out? Remember the call button. just click it and make it red.

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.