PHP cli remote debugger issue

I have this problem: I am trying to debug PHP scripts running through the CLI (I don’t care about doing this through the web server) either remotely, preferably - or locally.

I am on Linux both on a remote server and my local development machine using xdebug as well as netbeans / eclipse remotely or vdebug on vim locally.

So my problem is this: the remote machine runs PHP scripts in the background as we use them for system tasks, resource monitoring, etc. So when I try to debug script A (which I am working), the debugger ends up showing me the cron'ed scripts that run at the same time, making it impossible to work on what I am doing at the time.

Am I doing something wrong? I've tried several approaches, but I keep running into this problem all the time.

My current configuration is this, but I've tried many options.

zend_extension = /usr/lib64/php/modules/xdebug.so
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_autostart = On

      

Thoughts?

+3


source to share


2 answers


The problem was that I had xdebug.remote_autostart installed. Every PHP script that ran went through the debugger, whether it was the one I was working on or not.



The relevant part of the xdebug documentation is this: When running the script from the command line, you need to set the environment variable, for example: export XDEBUG_CONFIG = "idekey = session_name" php myscript.php

0


source


As I understand it, your IDE runs on a different machine than the script. In this case, the option

xdebug.remote_host = 127.0.0.1

should be the host your IDE is running on.



Make sure you have configured correctly idekey

as well as Eclipse.

Also make sure you have config in php.ini for CLI and not Apache.

0


source







All Articles