8

I have tried to set up Xdebug (2.2.3) with PhpStorm 7.0 and I cannot bring up the step-through debugging console as I have in the past. The guides that I have used to set this up are:

I know that the Xdebug extension itself is working as the cachegrind.out.3280 files are being created on page load (with 12Mb litany of all of the scripts required and variables/values). My set up in php.ini (php version 5.4.12) is:

zend_extension="c:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll"
xdebug.profiler_output_dir="c:/wamp/tmp"
xdebug.profiler_output_name="cachegrind.out.%p"
xdebug.profiler_enable=1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.idekey=xdebug
xdebug.remote_connect_back=1
xdebug.remote_host=dashboard.dev

After setting a break point, turning on Xdebug chrome extension, clicking to listen to Xdebug within PhpStorm and refreshing, I get the Incoming Connection from Xdebug dialogue:

 Incoming Connection from Xdebug

However, when I click Accept, the dialogue disappears and nothing happens.

If I then go to Settings / PHP / Servers in PhpStorm, I see that a new entry has been created: Settings / PHP / Servers in PhpStorm

Only by deleting the entry that was added can I get the Incoming Connection dialogue to show up again when I refresh the page. I notice that the port is set to 80 so wondering if that is right since the Xdebug extension is set to run over port 9000; when I click "Validate remote environment" select deployment server, then "Validate", I get: No debug extension is loaded. So I am assuming that the problem is something related to how this is set up.

10
  • 1
    1) xdebug port (9000) and website port (80) are two DIFFERENT things. You should learn some basics first: xdebug.org/docs 2) xdebug.remote_host=dashboard.dev that's actually wrong -- it should be your IP address / domain name, not your website domain. it works only because it points to the same IP as your computer (127.0.0.1). 3) "Only by deleting the entry that was added can I get the Incoming Connection dialogue to show up again" -- that's correct and works exactly as it should. Commented Nov 11, 2013 at 12:09
  • 1
    Now: 1) what is your PHP (not version number) -- is it 32 bit or 64 ? 2) Please show output of your phpinfo(); when executed via web interface (in a browser). Af far as I see it so far -- it should work for you OK -- I mean, it picks up incoming debug request. So .. what's happening after -- does it breaks on breakpoint? What will happen if you put xdebug_break(); in your code (programmatic breakpoint) ? Commented Nov 11, 2013 at 12:14
  • Nice pointers - my php is 32bit (PHP_INT_SIZE = 4) and, to my surprise, xdebug_break() gets the debugger console to work (but the red circle breakpoints do not). Commented Nov 11, 2013 at 12:20
  • 1
    1) Please show a screenshot with breakpoints -- maybe you have set them on a line where xdebug is unable to break (due to a bug or (most likely) the way how PHP itself generates bytecode); 2) "php_xdebug-2.2.3-5.4-vc9-x86_64.dll" -- this tells me that you are using 64-bit xdebug on 32-bit PHP -- it should not work, at all. Double check header table of phpinfo() output -- it should tell what Architecture your PHP is. Commented Nov 11, 2013 at 12:25
  • okay, well the Architecture is x64 so 64 bit ... I had used the accepted response to stackoverflow.com/questions/6303241/… which suggested that PHP_INT_SIZE = 4 indicates 32 bit but not necessarily reliable I suppose. Commented Nov 11, 2013 at 12:35

3 Answers 3

4

The problem was fixed by adding the break points to other parts of the code as it was not working when attached to the try clause. Additionally, here are some other tips that might be useful:

  1. Try using a programmatic breakpoint: xdebug_break();
  2. Check that if your php is 32bit then so is the version of Xdebug (or that they are both 64 bit).
  3. The xdebug remote host setting relates to the server IP address (so 127.0.0.1 for local).
Sign up to request clarification or add additional context in comments.

1 Comment

"The xdebug remote host setting relates to the server IP address (so 127.0.0.1 for local)." - What do you mean by this? I always thought we needed to put the ip of the connecting client here?
3

In your Phpstorm goto File > Settings > Languages & Frameworks > PHP > Debug.

Under External conections section, mark the checkbox saying

Ignore external connections through unregistered server configurations

This was fixed for me.

Comments

1

You need to configure the mapping between server path and local path in preferences / server

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.