Can't make xdebug work with php -S

Here's how I'm trying to make debugging in PHPStorm work:
1. Start php local web server using php -S -t /home/gadelat/Documents/Orange
2. In PHPStorm, Start listening for incoming PHP Debug Connections
3. In web browser, enable debugging and load page

Here is what I get:
If I click "Accept", here is what I get next:

Clicking on "Accept" at previous dialog creates following PHP server in settings:
Which is, in my opinion correct. But anyway, If I try to use mappings (even though I am not supposed to since paths are same on local and web server) and set it like this:

nothing changes.

Debugging works for another project which uses web server in virtual machine

Comment actions Permalink

Hi there,

1) Did you put valid breakpoints anywhere? (by valid I mean that xdebug is unable to stop at certain lines due to the way how PHP generates bytecode, e.g. multiline array, some multiline statements etc; that's why the breakpoints should be set on simple / single line statements)

2) What xdebug log says about it?

3) Will it break if you put xdebug_break(); in your code (programmatic breakpoint) ?

4) Will it break if you do as suggested on 2nd screenshot (enable breaking at first line)?

Comment actions Permalink

You were right, php didn't reach to the part of my application where I set the breakpoint. That was stupid from me not to check that. Case solved.

Comment actions Permalink

Hi there!

I'm evaluating PHPStorm and I'm facing the same problem. Can't make xdebug stop in any breakpoint in php code.

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="" 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[]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>

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

Log closed at xxxx


This is the php file I want to debug:


$hello = "world";
(*) if($hello == "my") {
echo "GREAT <br>";

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

I run the PHPStorm debug check tool and everything seems in place.

I do not know what to try more... Any hints?


Comment actions Permalink

Hi Mike,

1) Is it running locally (not VM or remote computer)?

2) Do you have any "proper" web server installed on your PC (Apache/Nginx/etc)?

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


P.S. You should really do this as separate thread .. as it's different to what the original author experienced (he solved his issue AFAIK)

Comment actions Permalink

Thanks Andriy. 

I will open a new thread and answer your questions.



Please sign in to leave a comment.