PHP interpreter on remote server / xdebug help

I am trying to test out the xdebug capabilities of PHPStorm 3.0.1

so far I had read all I can from PHPStorm and some random blogs on how this is done.


I have installed xdebug on my server, I have loaded the extension in my php.ini and i have specified the host, and port of my server for xdebug to run under (port 9001)

I then went to PHPStorm and under the settings > php > debug i selected xdebug as my debugger and set it to port 9001, i also went under php > debug > xdebut proxy and set up my IDE key, host, and port there (to match my php.ini values)


but from there i am stumped...i don't know what more to do. I tried to create a break point and debug, but I get the message that i haven't set up my PHP interpreter.

So i tried first under PHP > server and filled in my server details and selected xdebugger as my debug method.

then I went to PHP and added a new interpreter, but i'm seeing that its pulling it from my local php installation. Shouldn't it be pulling my xdebuger values from my remote server's php.ini values?

I would really like to learn how to set all this up because the tutorials all seem to be missing steps or indepth walkthru on how to go from zero to debugging (in this case)

7 comments
Comment actions Permalink

paste you php.ini xdebug settings in here.

mine look like this:
{code}

[xdebug]
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=192.168.0.2
xdebug.idekey=webide


{/code}


Then when you click on that green telephone icon, it should popup a dialog when any site on that server is run asking to ACCEPT or IGNORE.

If you ACCEPT it will ask you to setup your mappings then.

0
Comment actions Permalink

the question is where do i pull those values from?

I have xdebug instaleld on my remote web server, i have no idea which php.ini i need to append those to. the remote server? my local php install?

0
Comment actions Permalink

you can see the different settings for php.ini in the xdebug documentation:
http://xdebug.org/docs/remote

You can get your machines ip address by typing:
ifconfig

at the command line of your remote server.

You dont need a local php install at all.

-- edit --
for your local machines ipaddress on windows its ipconfig

0
Comment actions Permalink

oh, well in that case this is what i have in my remote server

;;;;;;;;;;;;;;;;;;;
; Xdebug Settings ;
;;;;;;;;;;;;;;;;;;;
xdebug.idekey = DEBUG
xdebug.remote_enable = On
xdebug.remote_host = xx.xx.xx.x <-- my server IP
xdebug.remote_port = 9001




i put those in manually.


another thing that error out on my in PHPStorm is that I need a PHP interpreter, but when I add one and then try to start the debug thing it loads up the php.ini for my local interpreter.

its all very confusing, someone needs to make a straight forward guide. Maybe I will and post it on youtube once I get this working for me. I'm sure there are a lot of other people out there in my possitions =)

Can you please help me?
0
Comment actions Permalink

Hi Eli,

1. You don't need xdebug proxy if you are not going to use it (it is used to allow simultaneous access for few developers and requires separate xdebug proxy script to be run elsewhere, e.g. on server).

2.

xdebug.remote_host = xx.xx.xx.x <-- my server IP

Wrong! Please read xdebug docs http://xdebug.org/docs/all_settings .
This should be your workstation IP address (where you run PhpStorm) as it is xdebug (server) who initiates connection to the client and not other way around.

3. You better stick with one manual/instructions and not combining all of them together as right now you do not have even xdebug configured properly. BTW -- is xdebug properly installed? When you execute simple script with <?php phpinfo(); ?>, do you see xdebug listed there?

Some links:

0
Comment actions Permalink

hah, yeah i didn't notice that IP issue.

and yes xdebug is installed successfully on my remote server, i have checked so before giving up and coming here for help =)


okay, so no proxy server. I deleted the proxy setting.

I tried every variation to try and connect to my server.

I started a new project to clear the settings, and set the xdebug_host to my IP on my local machine and matched the ports, but i still can't get a connection. What boggles me is, the lack of documentation for PHPStorm 3.0 (alot of the tutorials don't match in the settings dialoges, which makes it more difficult) without that assumption that people know how to set things up out of the box =/


I ended up giving up

0
Comment actions Permalink
  • Start PhpStom
  • Run | Start Listen PHP Debug Connections
  • From your server -- using telnet, try to connect to your desktop PC on xdebug port (e.g. 192.168.0.2:9001 or whatever syntax is).


If you were unable to connect -- then it can be

  • wrong IP or port
  • firewall blocking incoming connection (PhpStorm is the one that will receive connection, not xdebug)
  • firewall on your router (in case your server is on another network, e.g. somewhere on Internet


If you are able to connect -- then it is configuration issue:

  • path mappings
  • some other basic settings

I would suggest start with empty project, single very basic file to make sure it's working before moving to more complex stuff:

Have you seen these articles, by any chance? If not -- read and follow article step-by-step -- it has guide for installing and configuring xdebug etc:

0

Please sign in to leave a comment.