Get the App
SLTechnology News&Howtos  ›  Development  › 

How to configure Xdebug to debug PHP by phpstorm

Shulou Source: shulou.com Published: 2022-06-03 20:21:56 11月12日 Update

This article mainly introduces phpstorm how to configure Xdebug to debug PHP, the article is very detailed, has a certain reference value, interested friends must read it!

specific contents are as follows

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

1. PHP install xdebug extension

php.ini configuration, the following configuration is for reference only, the path to replace their 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, remote_port These have default values, but it is recommended to set them, at least know to set these parameters ~

View phpinfo~

2. PHPSTORM Settings

The owner used to use zendstudio. It was very painful to use phpstorm at first. After using it for a while, I found that it works well ~

1). First check phpstorm's xdebug configuration

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

2). Set debug.

Add local web server~

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

3). start debugging

After hitting the first breakpoint, shift + F9 is enough.

Make the first breakpoint, select debug configured, press the bug button next to it

The above is "phpstorm how to configure Xdebug to debug PHP" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Configuration version content breakpoints ports articles consistent for reference only value interest parameters guys buddies suggestions buttons time more landlord environment knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology MariaDB Docker vpn