PHPStorm with Xdebug on remote web server does not recognize breakpoints

Setup of PHPStorm/Xdebug using various web sites on JetBrains and Confluence regarding setup/config/troubleshooting debugging, but still having issues. The Run > Web Server Debug Validation passes without issue. The Console displays no errors and says the "process finished with exit code 0". I have tried breakpoint and xdebug_break(); in my code.

Initially I wanted to just debug the code up on the remote server, but it won't let me create a breakpoint when the code is remote, so I created a deployment link and connected to my local project, and the deployment/sync process also works fine.

Here are my logs from this morning where I have all of the above working and have the xdebug_break(); in place in my code. I am using the code from this web URL -- https://confluence.jetbrains.com/display/PhpStorm/Using+the+PhpStorm+Debugger with the breakpoint just above the $five = add(2,3); line.

Additionally, when I run it I get a popup in the debug pane stating "connection with xdebug 2.2.7 was not established, validate installation" and when I validate it says "xdebug 2.2.7 extension is installed.  Check configuration options, show phpinfo".  Not sure what to look at from here, but this is what is in my php.ini file...

[Xdebug]
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=a1ssvc09.lab.acme.com
xdebug.remote_port=9000

Any help would be greatly appreciated, thanks.

------------------------------------------------------ IDE STARTED ------------------------------------------------------
2018-10-25 07:50:10,911 [ 9] INFO - #com.intellij.util.ui.JBUI - User scale factor: 1.0
2018-10-25 07:50:10,911 [ 9] INFO - #com.intellij.util.ui.JBUI - System scale factor: 1.25 (IDE-managed HiDPI)
2018-10-25 07:50:10,917 [ 15] INFO - #com.intellij.idea.Main - IDE: PhpStorm (build #PS-173.4674.46, 15 Mar 2018 12:10)
2018-10-25 07:50:10,917 [ 15] INFO - #com.intellij.idea.Main - OS: Linux (3.10.0-693.21.1.el7.x86_64, amd64)

4 comments

Here is the phpinfo produced when the "xdebug 2.2.7 extension is installed.  Check configuration options, show phpinfo" appears and you click on the link.

PHP version: 5.3.3
PHP CLI: /usr/bin/php
PHP CGI: /usr/bin/php-cgi

0

Please note that in PHP, it's the Xdebug that initiates the TCP connection, not PhpStorm.

As far as I get it, you're trying to debug code execucted on a1ssvc09.lab.acme.com. In this case, Xdebug takes the xdebug.remote_host value, and tries to send the debug data to port 9000 of this host.

It's supposed that port 9000 is being listened by PhpStorm.

However, your xdebug.remote_host is set to the server hostname itself, and there's nothing that is listening to this port there.

Can your server connect to your developer machine directly? If it can, just fix that xdebug.remote_host parameter.

If it can't, you need to use the remote SSH port forwarding in order to get the Xdebug request to reach Phpstorm: https://confluence.jetbrains.com/display/PhpStorm/Remote+debugging+in+PhpStorm+via+SSH+tunnel

0

Ok inside my VM, I opened a terminal window and followed the information to setup an SSH tunnel.  I also ran the browser inside of my VM with the xdebug-helper extension.  Either way, using the browser or using the debug inside of PHPStorm, nothing works.  I get the same output.  If I am using the SSH tunnel, what do I need to change the value of xdebug.remote_host to?  Here's the latest part of my logs, if that helps.  Thanks again.

0

Usually, Xdebug remote log is very helpful in these cases.

Please configure it on the remote server (make sure to create the file and set permissions manually, also don't forget to restart Apache), try to initiate a debugging session with a browser and then upload the Xdebug log somewhere.

I know it's out fault that we don't provide any way to upload logs on forums, but please don't paste huge amounts of text into your replies - it tears the post apart and makes navigating through it so much more complicated. Thank you!

You can use services like Pastebin instead.

0

Please sign in to leave a comment.