Still struggling to get xDebug setup

I love phpstorm. But I am still struggling to get xdebug set up. I hvae read all the tutorials and posts and still need some help.

Here is my setup.

  • I have a remote development server (192.168.5.35) set up in our internal network. I have installed xdebug on that server. It is working. It shows in my phpinfo(). It is creating cachegrind files nicely.
  • The domain name (internal) for the site is http://jaen.com
  • I develop on my desktop (192.168.5.100).
  • I have created a project from existing files that are on the dev server. I am able to connect via drive mapping but have actually created a local copy of the php files.
  • My php server settings: Name: JAEN Host: http://jaen.com, port: 80, debugger: xdebug


My questions:

  • Where does the xdebug run from, the development server or my desk top?  When I go to Settings | PHP the Interpreter only shows php installations on my local desktop computer. When I attempt to debug, it runs my local php.


I want to be able to debug the code that is on the dev server and have it feed back into phpstorm.

I would appreciate any suggestions.

1 comment
Comment actions Permalink

Hi there,

Where does the xdebug run from, the development server or my desk top?

In the same place where PHP is run (as xdebug is just a (special) PHP extension).

But generally speaking: xdebug is the one who initiates connection to debug client (PhpStorm in our case). So make sure that PhpStorm is trusted in firewall/router and  xdebug port is open and PhpStorm is the one who listens on xdebug port (when you click on "phone handle" icon) -- you can use standard "netstat" or graphical "tcpview" (download from Microsoft website -- FREE).

When I go to Settings | PHP the Interpreter only shows php installations on my local desktop computer.

Correct -- PhpStorm does not currently support interpreters on remote machines. Plus, interpreter is used when executing your code locally in CLI environment (e.g. "PHP Script" type of Run/Debug Configuration, executing Phing tasks, PHPUnit testing, CS and PHPMD integration etc)

When I attempt to debug, it runs my local php.

Most likely (based on this description) you have created Run/Debug Configuration of wrong type -- sounds like it is a "PHP Script" instead of "PHP Remote Debug" or "PHP Web Application" etc.

TBH -- you do not need to create any run/debug configuration -- just use "Zero Config" approach:


Obviously, you also need to check that xdebug is configured properly on your server -- remote_host is particular -- it should point to your IP where PhpStorm is running.

I want to be able to debug the code that is on the dev server and have it feed back into phpstorm.

You still need local copy of those PHP files on your computer (unless IDE can access them directly over network, which is not recommended for performance reasons), obviously.

0

Please sign in to leave a comment.