Volmarg Reiso
Volmarg Reiso

Reputation: 483

PhpStorm remote Xdebug

I've got problems with setting up Remote Web Server Debugging with Xdebug. I keep getting 404 error:

enter image description here

but actually Xdebug is being detected correctly:

enter image description here

How are machines setup

What works fine at this point

What I already tried


    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

I'm out of ideas at this point.

P.S. I'm newbie to Linux.

Upvotes: 0

Views: 1663

Answers (1)

Volmarg Reiso
Volmarg Reiso

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.

  1. Creating new remote project
  2. Defining connection with FTP (in my case I’m connecting to my laptop with Ubuntu)

enter image description here

At this point the difference is that:

  • I’ve pointed the location manually
  • I’ve changed the Web server root URL, previously it was just IP without port etc

Next thing is Mapping. Once I’ve setup correct path in Connection tab all I had to do is:

enter image description here

  1. Selecting CLI and Path mapping

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.

enter image description here

Now once You press the marked button in CLI line, You will see new windows. In my case xdebug was detected.

enter image description here

Press „Open in Editor”

  1. Xdebug settings

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):

enter image description here

It’s worth mentioning that I had 127.0.0.1 as remote_host and Validation tool actually detected my Desktop IP this time.

  1. Validating Xdebug connection enter image description here

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.

enter image description here

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

Related Questions