xDebug on a remote Server

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
Algarvio
Posts: 3
Joined: Wed Oct 16, 2013 9:29 pm

xDebug on a remote Server

Post by Algarvio »

Hi all,

can anybody tell me how to debug php scripts running on a remote server?

I have a local network where there is a workstation (Development) and a server (WAMP). What needs to be done is to be able to debug a script running on the server from the workstation. Is this possible? In all examples I saw, there was the PHP interpreter running on the same (local) machine.

On the server there is xDebug Version 2.1.2 up and running. In the php.ini file I enabled "xdebug.remote_enable = on". :x

Any help would be appreciated
Thanks Algarvio
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: xDebug on a remote Server

Post by Aivars »

The main issue is that in order to make debugging on remote server possible, the server has to be able to connect to your local machine because that's how xDebug works - server connects to the debugger and sends back debugging info. Besides that you need to configure WeBuilder to use the remote server instead of the local one via Settings -> Preview -> Mappings and then it could work. But you will need the file that you're debugging on both local and remote machines.

It is easier to debug locally.
Blumentals Software Programmer
Algarvio
Posts: 3
Joined: Wed Oct 16, 2013 9:29 pm

Re: xDebug on a remote Server

Post by Algarvio »

Hi Aivars,

perhaps I better describe my development environment:

Workstation (Win7): IP 192.168.0.10
Server (WinXP SP3): IP 192.168.0.100

- WAMP Stack on Server (Apache 2.x, PHP 5.3, MySQL 5.x, xDebug enabled)
- Projects on the server are access able via http://www.server.dev/ALL_DATA_IN_FOLDERS_BELOW OR by Dev-Domain-Name such as: http://www.example.dev etc.
- Projects I mainly work on: Joomla

How do I do this then?

What do you mean, when you say:
But you will need the file that you're debugging on both local and remote machines.
Does this mean, I have to mirror the whole Joomla installation on the workstation?

Thanks
Algarvio

P.S. I'm using PHP Rapid Editor 2014
User avatar
Aivars
Blumentals Software Developer
Posts: 2462
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: xDebug on a remote Server

Post by Aivars »

How are you currently editing the files, via mapped drive? If so then you won't need to mirror them, just specify in Mappings to use the dev domain name. If you're using FTP connection to edit the files (files can't be accessed directly via file system) then you'll need to mirror them for debugging.

http://xdebug.org/docs/all_settings#remote_host - this is the setting you need to set to 192.168.0.10 in xDebug conf.
Blumentals Software Programmer
Algarvio
Posts: 3
Joined: Wed Oct 16, 2013 9:29 pm

Re: xDebug on a remote Server

Post by Algarvio »

Hi Aivars,

and sorry for being late.

In terms of files and mappings I do the following:
Server: E:\httpdocs is shared as httpdocs
Here I have the following structure: E:\httpdocs\Clients\NAME\project\html\
This is where the stuff is I'm working on and which needs to e debugged (mostly Joomla Installations).

Workstation: The above drive is mapped. So I see the structure some how: Clients\NAME\project\html\

I can have a Dev-Domain Name for each client/project. For example http://www.example-name.dev is stored on the server here: E:\httpdocs\Clients\NAME\project\html\

Can you tell me, how do I have to map things? Needs this to be done per Client or can this be set up in a general/global way?

Second: PHP Settings
What do I do with the PHP settings in the options section of the editor? Is it neccessary, and if so what path do I insert when there is no local PHP interpreter available? Do I have to share the PHP folder on the server, map it, and use this path?

Third: Debugger Settings
Any recommendations here? Or leave it like it is?

And finally, please give a hint of a really simple testing example as my debugging career is a bit outdated.

Thanks so far
Algarvio
Post Reply