Can't make PHPStorm work with XDebug

Hi there!

I'm evaluating PHPStorm and I just can't debug using xdebug. Xdebug do not stop in any breakpoint in php code neither if I set PHPStorm to break on first line in PHP scripts.

This is the log file for xdebug:

Log opened at xxxx
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///www/myproject/whereis.php" language="PHP" xdebug:language_version="5.6.19" protocol_version="1.0" appid="1377" idekey="PHPSTORM"><engine version="2.4.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>

Log closed at xxxx

 

This is the php file I want to debug:

 

<?php
$hello = "world";
(*) if($hello == "my") {
echo "GREAT <br>";
}
var_dump($hello);
phpinfo();

The breakpoint is in the line market with (*).

I run the PHPStorm debug check tool and everything seems ok.

 

1) Is it running locally (not VM or remote computer)? I'm running locally.

2) Do you have any "proper" web server installed on your PC (Apache/Nginx/etc)? I have Apache 2.4, PHP 5.6.19  with Xdebug v2.4.0.

3) If you do -- how's your PHP is running there (apache module/fastcgi/etc)? My Apache is running using 

 

UPDATED: I changed the Xdebug default remote port from 9000 to a different one and now it seems working. It seems my problems are NOT related to PHPStorm.

Regards.

0

Based on the log (the behaviour: it connected to some service and then disconnected with no additional commands received) ... it looks like you have php-fpm running. By default it uses TCP 9000 port (the same port that xdebug uses).

You can check that by checking what services are listening on TCP 9000, for example: sudo lsof -nP -iTCP -sTCP:LISTEN (that's for Mac; not sure what OS you have, but netstat or similar should do the job).

If that is the case, then changing xdebug port (in both php.ini and PhpStorm) should resolve your issue.

0
Avatar
Permanently deleted user

Thanks Andriy. 

That did the trick. :)

Regards.

0

请先登录再写评论。