简体   繁体   中英

How to use Xdebug in PhpStorm

I have a trouble to use debugger in my code, it's my first time to use debugger, I don't know that I am doing it the right way or not, but it is not working for me. it always show this message in variables section...

Waiting for incoming connection with ide key '13001'

I followed this step...

1. my php.ini setting for xdebug

[Xdebug]
zend_extension="D:\XAMMPI\php\ext\php_xdebug-2.4.0-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=80 //i also try the default port (9000) here but it still not working
xdebug.idekey=PHPSTORM

2. I create the configuration setting for Debugger.

配置设置

3. I apply the break point to code for testing

断点的地方

I am using PhpStorm 2016.1

Any help will be appreciated

UPDATE - 1

在此输入图像描述

Just use my php.ini setting for xdebug

[XDebug]
zend_extension="D:\XAMMPI\php\ext\php_xdebug-2.4.0-5.6-vc11.dll" ; copied this link based on your config.
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=10000
xdebug.remote_autostart=1
xdebug.idekey=

Then install xDebug helper for chrome:

https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en

Then change the IDE key to phpstorm 将IDE密钥更改为phpstorm

After that, you should create a PHP Remote Debug and not PHP Web Application

Like the picture below.

在此输入图像描述

On your settings. Which can be accessed using Ctrl+Alt S . Search for Debug port, and change it to 10000.

在此输入图像描述

After that you should navigate to your extension in chrome and activate xDebug.

在此输入图像描述

And that's it. Happy Debugging :)

Waiting for incoming connection with ide key '13001'

vs

xdebug.idekey=PHPSTORM

you need to set proper idekey in PHPStorm, and change back ports to 9000. 80 is port for apache (http server), so it will not work as you've configured.

Look here to learn where to set the idekey in ide: https://www.jetbrains.com/help/phpstorm/2016.1/run-debug-configuration-php-remote-debug.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM