1

Environment:

Windows 10 > Linux (Ubuntu Server) via LAN
PhpStorm

Followed https://xdebug.org/wizard.php and https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html

php.ini (/etc/php/7.2/fpm/php.ini as using Nginx) has:

zend_extension = /usr/lib/php/20170718/xdebug.so

xdebug.remote_enable = On
xdebug.remote.connect_back = 1
;xdebug.remote_host=192.168.56.1;commented out as copied from another PC with VBox (x-debug working here) but left for reference
xdebug.remote_port=24680;port 9000 is usually occupied by FPM, so port change recommended
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
xdebug.remote_log="/tmp/xdebug.log"

* EDIT- using xdebug.remote_host=192.168.0.201 works but I want to use multiple network locations to debug from preferablly also WAN *

I have setup bookmarklets as per PhpStorm link and clicked the bookmarklet:

javascript:(/** @version 0.5.2 */function() {document.cookie='XDEBUG_SESSION='+'PHPSTORM'+';path=/;';})()

In the actual IDE the View>debug window is greyed out but allow incoming connections all green. The Language>PHP>Debug is set to stop at first line and has same port number 24680. In setups on other systems I have at least had flagged up that mappings need attention but I simply cannot get to any debug view here.

tail -f /tmp/xdebug.log

gives:

Log opened at 2018-08-24 21:52:05
I: Connecting to configured address/port: localhost:24680.
W: Creating socket for 'localhost:24680', poll success, but error: Operation now in progress (29).
W: Creating socket for 'localhost:24680', poll success, but error: Operation now in progress (29).
E: Could not connect to client. :-(
Log closed at 2018-08-24 21:52:05

Showing response. Obviously something missed with connecting back to Windows client PhpStorm. Tested with Windows firewall off

I will also need to connect remotely via port forwarding to this server at some point, however all this initial setup is on LAN.

When I mention setups regarding other systems they are physically seperate (IE Macbook talking to its own VBox). This setup is a windows machine talking to a real Linux server on the same LAN. SSH is not used here.

php.ini is (/etc/php/7.2/fpm/php.ini as using Nginx)

Anyone got any idea ?

enter image description here

enter image description here

Datadimension
  • 963
  • 1
  • 8
  • 22
  • 1
    *"Disappointed that with such a leading edge IDE that PHP debugging seems to be such a hit and miss process."* Do not blame IDE if you cannot configure PHP (Xdebug in this particular case) on a server. According to your xdebug log Xdebug tries to connect to `localhost:24680`. Since you are running this on your Ubuntu machine ... then obviously this will NOT connect to a Windows machine... right? – LazyOne Aug 25 '18 at 08:23
  • 1
    Did you rule out firewall issues? I think it's possible that Windows Firewall blocks incoming connections by default on your "public" LAN interface and maybe allowed it on the HostOnly VBox adapter. Maybe you can test to establish a connection with netcat from your Ubuntu system to the Windows at this port. – Tobias K. Aug 25 '18 at 08:25
  • You do have `xdebug.remote.connect_back = 1` .. so Xdebug should be auto-detecting the remote IP ... but based on `Connecting to configured address/port: localhost:24680` line from Xdebug log .. it suggests that you may have some another php.ini in place or something (as it does not try to detect but connects to a specific address straight away). Please capture `phpinfo()` output via browser and 1) check what php.ini (or other config files) is used -- maybe you have edited the wrong one and 2) Provide whole Xdebug section to check what settings are actually configured. – LazyOne Aug 25 '18 at 08:27
  • Perhaps you are trying to debug over SSH tunnel (where connecting to localhost makes perfect sense)? ... but according to the info you have provided so far it unlikely to be the case or you just do not know (for sure) how it all configured there. Please double check actual Xdebug config on your Linux server side. So far I see that the Xdebug connection does not even leave your Linux machine and PhpStorm is not aware of incoming debug request. – LazyOne Aug 25 '18 at 08:33
  • Tested with Windows firewall OFF – Datadimension Aug 25 '18 at 13:02
  • Edited the question to reflect some helpful points (tho not solved this yet). – Datadimension Aug 25 '18 at 13:31
  • Can you check [like here](https://stackoverflow.com/a/23718720/7362396) whether PHPStorm is listening at all / at the correct port (24680)? – Tobias K. Aug 25 '18 at 14:12
  • Where is the xdebug section of `phpinfo()` output (captured via browser)? Right now I can say that the behaviour showed in Xdebug log does not correlate to your xdebug settings. – LazyOne Aug 25 '18 at 16:13
  • Added port info and xdebug phpinfo – Datadimension Aug 26 '18 at 10:17
  • In desperation I altered line in php.ini to xdebug.remote_host=192.168.0.201, however this is not a solution as will want to debug from more than 1 network location - preferably also over WAN – Datadimension Aug 26 '18 at 10:29
  • Now ... xdebug settings that you have provided clearly show where that `localhost` (from xdebug log) came from ... and also **confirms** that you have `remote_connect_back` option disabled there .. which **confirms** what is seen in xdebug log and **contradicts** to your xdebug config in php.ini So once again -- please figure out what config is used there .. because I clearly see contradiction in what should be there and what actually is. Right now xdebug log behaves correctly accordingly to **actual** xdebug settings you have provided. – LazyOne Aug 29 '18 at 19:10
  • Oh ... just noticed `xdebug.remote.connect_back = 1` --- you have dot `.` instead of underscore `_` in that option name. Fix that and try again – LazyOne Aug 29 '18 at 19:12

0 Answers0