Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XDebug, how to disable remote debugging for single .php file?

Tags:

php

xdebug

I'm using Eclipse IDE + remote Xdebug. EclipseIDE is listening 9000 port for some kind of Xdebug information.

There are some php scripts running by cron on server. So, every cron execution xdebug is sending information to my workstation and EclipseIDE is trying to find this file in my project. But file couldn't be find because cron running scrits do not relate to the project I'm working with. So, every cron run Eclipse IDE is alerting this message http://img2.pict.com/22/fc/86/3299517/0/screenshot2b142.png

I've tried to add to cron executed php scripts some strings...

if (function_exists('xdebug_disable')) {
  xdebug_disable();
}

... but it didn't helped.

Any ideas?

Thank you

like image 479
Kirzilla Avatar asked Apr 03 '10 08:04

Kirzilla


People also ask

How do I change my Xdebug mode?

You can also set Xdebug's mode by setting the XDEBUG_MODE environment variable on the command-line; this will take precedence over the xdebug. mode setting, but will not change the value of the xdebug.

How do I disable Xdebug in composer?

As of Xdebug 3, it is possible to disable the Xdebug completely by setting the option xdebug. mode to off , or by setting the environment variable XDEBUG_MODE=off . It is very easy to disable Xdebug just for composer, by aliasing composer . You can add the alias to your $HOME/.


1 Answers

As I've investigated I should set xdebug.remote_autostart=0 See documentation: http://xdebug.org/docs/remote

Important! You should change this value through php.ini. Using function ini_set('xdebug.remote_autostart', 0) won't work because sesion has already started and you'll be still getting xdebug information to your remote host.

like image 186
Kirzilla Avatar answered Nov 15 '22 16:11

Kirzilla