XDebug,如何禁用单个.php文件的远程调试? [英] XDebug, how to disable remote debugging for single .php file?

查看:78
本文介绍了XDebug,如何禁用单个.php文件的远程调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse IDE +远程Xdebug. EclipseIDE正在侦听9000端口,以获取某种Xdebug信息.

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

服务器上cron运行着一些php脚本.因此,每个cron执行xdebug都会向我的工作站发送信息,而EclipseIDE会尝试在我的项目中找到该文件.但是找不到文件,因为cron运行脚本与我正在处理的项目无关.因此,每台运行cron的Eclipse IDE都会警告此消息 http://img2.pict.com/22/fc/86/3299517/0/screenshot2b142.png

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

我尝试向cron执行的php脚本添加一些字符串...

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

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

...但是没有帮助.

... but it didn't helped.

有什么想法吗?

谢谢

推荐答案

经调查,我应该设置 xdebug.remote_autostart = 0 请参阅文档: http://xdebug.org/docs/remote

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

重要!您应该通过php.ini更改此值.使用函数ini_set('xdebug.remote_autostart',0)无效,因为会话已经开始,并且您仍将xdebug信息获取到远程主机.

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.

这篇关于XDebug,如何禁用单个.php文件的远程调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆