我希望使用不同计算机的团队能够在远程服务器上调试PHP ,但我很难让Xdebug在NetBeans 7.0.1中工作.我尝试过很多在线提示,但无济于事.
为了记录,我已在运行WampServer的Windows 7计算机上本地成功安装了Xdebug .所以我可以在NetBeans中使用断点调试PHP,前提是我将Project Properties-> Run Configuration-> Run As属性设置为Local Web Site.但是,如上所述,我的目标是在远程Web站点上的NetBeans中进行调试.
我的服务器是Ubuntu 11.04机器.我使用http://www.xdebug.org/find-binary.php的输出将适当的二进制文件放在机器上.我已经修改了php.ini我能找到的所有文件(在php5/apache2和php5/cli目录中)以包含这些行:
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
Run Code Online (Sandbox Code Playgroud)
如果我查看phpinfo.php网页,它会说:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
Run Code Online (Sandbox Code Playgroud)
所以Xdebug似乎确实安装得很好.不过,当我在NetBeans中尝试调试时,我会收到无休止的状态栏消息Waiting For Connection(netbeans-xdebug).当我按下停止按钮时,我得到xdebug的X连接未在X秒内被检测到.原因可能是未安装或未正确配置xdebug.
也许我在这里混淆了服务器设置的本地设置?一个帖子说, …
我为PhpStorm和xdebug配置了所有工作,我正在运行Ubuntu 14.04.
没有建立回IDE的连接,我在IDE事件Log中得到了这个
无法接受外部Xdebug连接:无法计算表达式'isset($ _ SERVER ['PHP_IDE_CONFIG'])' - Osama Salama 13分钟前
我将把我在不同地方配置的配置值放在一起.因为我无法找出问题所在
php.ini中
zend_extension = /usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_connect_back = 1
xdebug.remote_autostart = 1
xdebug.remote_log=xxx/xdebug.log
xdebug.IDE_key=PHPSTORM
Run Code Online (Sandbox Code Playgroud)
PHP信息
Xdebug的
xdebug support enabled
Version 2.3.1
IDE Key PHPSTORM
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.cli_color 0 0
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable On On
xdebug.default_enable …Run Code Online (Sandbox Code Playgroud)