Reputation: 483
I've got problems with setting up Remote Web Server Debugging with Xdebug. I keep getting 404 error:
but actually Xdebug is being detected correctly:
How are machines setup
What works fine at this point
What I already tried
Checking out forwarding/tunnel for SSH Xdebug and PhpStorm remote does not work
Following this : https://help.ubuntu.com/community/SSH/OpenSSH/Configuring. I've tried turning this settings on, since were off:
AllowTcpForwarding yes X11Forwarding yes
Tried to change settings for both php.ini and xdebug.ini, (both and apart)
zend_extension=/usr/lib/php/20170718/xdebug.so xdebug.remote_autostart = 1 xdebug.remote_enable = 1 xdebug.remote_handler = dbgp xdebug.remote_host = 127.0.0.1 xdebug.remote_log = /tmp/xdebug_remote.log xdebug.remote_mode = req xdebug.remote_port = 9005
DocumentRoot
was setup on /var/www
while my project was somewhere else so I move project to /var/www
and still nothing - but works OK on given IP above.I'm out of ideas at this point.
P.S. I'm newbie to Linux.
Upvotes: 0
Views: 1663
Reputation: 483
First of all I’m unable to pinpoint what was exactly the problem, however I’ve got few ideas looking on what I’ve changed and it suddenly started to work.
Step by step what I’ve made in order to make connection work this time.
At this point the difference is that:
Next thing is Mapping. Once I’ve setup correct path in Connection tab all I had to do is:
Once the connection is established, There will be list of detected remote CLI Interpreters. I’ve picked up my Laptop’s Ubuntu. Again keep an eye on Path mappings, it should be the same Root Path above.
Now once You press the marked button in CLI line, You will see new windows. In my case xdebug was detected.
Press „Open in Editor”
Below are the settings I’ve got in php.ini:
zend_extension = /usr/lib/php/20170718/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_connect_back = 1
xdebug.remote_host = "192.168.1.100" //This is my Desktop PC IP
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9101 //This is the port under which I want xdebug to work remotely
xdebug.idekey = "PHPSTORM"
Below are settings for my Xdebug.ini file on Ubuntu (the same as above):
It’s worth mentioning that I had 127.0.0.1 as remote_host and Validation tool actually detected my Desktop IP this time.
Keep an eye on underlined sections – this are my settings. Now go to Validate.
Upon pressing Validate, You should see settings like these below. Again be sure to pick up proper Remote connection.
The rest goes just with the official guide – setup Xdebug extension in browser and start listening for incoming connections.
Below are some useful links that might be helpful in case You will have some other kind of problems.
Upvotes: 0