Get the App
SLTechnology News&Howtos  ›  Development  › 

How to configure Xdebug for PHP code debugging by phpstorm

Shulou Source: shulou.com Published: 2022-06-03 19:04:06 11月12日 Update

This article introduces the relevant knowledge of "how to configure Xdebug for PHP code debugging in phpstorm". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Operating 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: the php version and the xdebug version must correspond

1. PHP installs the xdebug extension

Php.ini configuration, the following configuration is for reference only, 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, but it is recommended to set them, at least knowing that you need to set these parameters ~

View phpinfo~

2.PHPSTORM Settin

The landlord used to use zendstudio all the time, but at first it was very painful to use phpstorm. After using it for a period of time, it was found to be quite easy to use.

1. First check the xdebug configuration of phpstorm

The debug port here should be consistent with the xdebug.remote_port in php.ini! The default is 9000. If port 9000 is occupied, it can be changed to another port.

two。 Set debug.

Add a local web server~

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

3. Start debugging

Hit the first breakpoint, shift + F9 will be fine.

Hit the first breakpoint, select the configured debug, and press the bedbug button next to it

Summary:

Depending on the breakpoint configuration, or during the opening of Debug URL, or after POST, if the PhpStorm listens for a Debug connection, it immediately switches to the editor interface and jumps to the set breakpoint, and the browser waits for the PhpStorm operation.

This is the end of the introduction of "how to configure Xdebug for PHP code debugging in phpstorm". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Configuration version breakpoint code content more knowledge port process practical consistent for reference only learned next parameters dilemma actual suggestion situation button Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft MariaDB Docker Huawei