Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
How to configure PhpStorm Remote Xdebug path mapping

I have setup and docker machine that runs my application. In this docker machine xdebug is enabled with these xdebug.ini settings.

zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_host=10.5.0.1

My local machines IP is 10.5.0.1

When I try to run my application on command line, it connects back to PhpStorm debugger. But because of there is no path mapping it stops at the first line of the script, break points doesn't work. Break point cursor is not visible, I can't track the code by F8 key.

Also, it must show some kind of path mapping error Debugger->Variables windows, but it doesn't show any error.

How to fix this?

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I could fix this problem, PhpStorm can not handle if serverName is not configured.

What to do:

1. Setup environment variables:

export XDEBUG_CONFIG="idekey=PHPSTORM"
export PHP_IDE_CONFIG="serverName=web_server_cli"

2. Setup path mapping for that servername:

Go to Settings > Languages & Frameworks > PHP and create a server with a hostname web_server_cli

about 4 years ago · Santiago Trujillo Report

0

settings > languages and frameworks > php > servers Add your server, and add your path mapping! An example would be C:\Sites\mysite mapped to remote /var/www/mysite or similar

about 4 years ago · Santiago Trujillo Report

0

You need to set up a "server" configuration in "Settings > Languages and Frameworks > PHP > Servers" which maps the paths as seen on the server to the paths in your project.

Normally, you would enter a URL into "Host" and set "Port" to the HTTP port, e.g. 80 or 443. For CLI scripts, the info to put in here will be based on your connection to the server where the CLI script runs. For instance, if you SSH to 192.168.42.42 on the standard SSH port (22), you would enter "Host: 192.168.42.42", and "Port: 22".

To find out what details you need to set up, go into "Settings > Languages and Frameworks > PHP > Debug", enable "Force break at the first line when no path mapping specified", and make sure "Ignore external connections through unregistered server configurations" is not ticked. Then click "Listen for debug connections" in the toolbar, and run your script; a dialog box should pop up showing the "Server name:" and "Server port:" it is trying to match, as well as confirming the remote file path. Click "Ignore" on that dialog, set up the server mapping, and try again, and you should get a proper debug session.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!