Cannot get remote debugging to work with PHPStorm and WAMP on local PC

I am unable to get remote debugging working with PHPstorm. My server environment is Windows 8.1 and WAMP 2.4.  PHPStorm is version 7. "Listen for debug PHP connections" is active.
The validate remote environment shows everything is okay. I have created a very simple project and one simple PHP file. I have also created a web application referencing the PHP file. I set a breakpoint on the PHP file at the first line. When I click on "debug the web application", the debug window shows that PHPstorm is waiting for connection from ide key 17736. The browser opens and shows my PHP page with "?XDEBUG_SESSION_START=17736" appended to the URL. Nothing happens and PHP storm never receives the connection. Refreshing the page does nothing as far as the debugger is concerned. Creating a "PHP script" and debugging the same program results in the debugger becoming active and showing variables, etc. So the problem is remote debugging connection. Any thoughts?

simple.php

<?php
echo 'got here(first line)<br>';
phpinfo();
echo "got here(last line)<br>";
?>

PHP.ini
xdebug.remote_enable = 1
xdebug.remote_host="127.0.0.1;"
xdebug.remote_port=9000;
xdebug.idekey="PHPSTORM";
xdebug.remote_handler="PHPSTORM";
;xdebug.profiler_enable = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "e:/wamp/tmp"


Thanks

8 comments
Comment actions Permalink

Hi there,

As I understand the IDE and actual web server are both running on the same computer/environment (not virtual or LAN etc)?

1) Please show output of your phpinfo(), header (the very first table) and xdebug section in particular. This script with phpinfo() needs to be run via browser (since this is where your problem is) and not command line.

2) What kind of WAMP stack do you use (URL for website)?

0
Comment actions Permalink

Additional info:

log file

Log opened at 2013-12-19 15:25:55
I: Connecting to configured address/port: 127.0.0.1;:9000.
E: Could not connect to client. :-(
Log closed at 2013-12-19 15:25:55

0
Comment actions Permalink

I: Connecting to configured address/port: 127.0.0.1;:9000.
E: Could not connect to client. :-(

This is very obvious -- you have unneeded semicolon ; character as part of the address -- remove it.

xdebug.remote_host="127.0.0.1;"
0
Comment actions Permalink

Everything is running on my local PC. The url that is created when I click on "debug" the web app is:

http://localhost:779/testwithwamp2/phpinfo.php?XDEBUG_SESSION_START=16316

I have modified the apache config file to listen for the additional port 779.

The page displays perfectly in the browser.

I will do another reply with the requested data.

Thanks,

0
Comment actions Permalink

That fixed the problem. Thanks! However, I had created the web application to keep things simple when trying to find the problem with the remote connection. What I really want to do is "zero configuration" debugging. So I have  "phpinfo.php" open in the editor. I have installed the debug plugin in Chrome and Chrome in my default browser. So  I click on "open in browser" and Chrome opens with the url:

http://localhost:63342/testwithwamp2/phpinfo.php

The "phpinfo.php" is the same file that I referred to previously as "simple.php"

port 63342 is the javascript debug port according to the settings page. Should I add port 63442 to the apache config file or is there some other thing wrong? The browser waits forever since port 63342 is unknown to apache.
Thanks

0
Comment actions Permalink
port 63342 is the javascript debug port according to the settings page.

Not exactly. It's an IDE port for various communications with web browser / browser plugins (JS debug, LiveEdit functionality etc). In your particular case it is used for accessing simple built-in web server.

Should I add port 63442 to the apache config file

No.

or is there some other thing wrong?

Yes. Correctly setup deployment entry (Settings | Deployment):

  • Fill all required fields in "Connection" and "Mappings" tabs
  • Mark this entry as Default for this project.


With deployment entry properly configured it will use URL from there instead of default built-in web server.

0
Comment actions Permalink

Additional info

If I remove the ":63342" manually and refresh the page, the breakpoints work and everything seems OK.

0

Please sign in to leave a comment.