2012-07-05 126 views
0

我试图让我的php调试器为NetBeans在Ubuntu上工作。当我尝试启动调试会话时,它会尝试永久建立连接,但最终会给我一条错误消息,指出没有可用的netbeans-xdebug连接。我已经安装了php5-xdebug,但是当我尝试使用phpinfo()查看它时,它不显示。我的PHP /的Apache2/php.ini中有几行代码:已安装XDebug,但未显示在phpinfo()中并且不起作用

zend_extension=/usr/lib/php5/20090626/xdebug.so 
[debug] 
; Remote settings 
xdebug.remote_autostart=off 
xdebug.remote_enable=on 
xdebug.remote_handler=dbgp 
xdebug.remote_mode=req 
xdebug.remote_host=localhost 
xdebug.remote_port=9000 
xdebug.idekey="netbeans-xdebug" 

; General 
xdebug.auto_trace=off 
xdebug.collect_includes=on 
xdebug.collect_params=off 
xdebug.collect_return=off 
xdebug.default_enable=on 
xdebug.extended_info=1 
xdebug.manual_url=http://www.php.net 
xdebug.show_local_vars=0 
xdebug.show_mem_delta=0 
xdebug.max_nesting_level=100 
;xdebug.idekey= 

; Trace options 
xdebug.trace_format=0 
xdebug.trace_output_dir=/tmp 
xdebug.trace_options=0 
xdebug.trace_output_name=crc32 

; Profiling 
xdebug.profiler_append=0 
xdebug.profiler_enable=0 
xdebug.profiler_enable_trigger=0 
xdebug.profiler_output_dir=/tmp 
xdebug.profiler_output_name=crc32 

正如你所看到的,我试图解决它自己,但我不能得到它的工作。任何帮助将不胜感激......

+0

请,任何人 叫@ /var/www/testxdebug.php:8 ... – 2012-07-05 09:26:24

+0

你确定这个文件在那条路上吗? – fedmich 2012-07-05 09:33:02

+0

是的,检查,以及它在那里... – 2012-07-05 09:38:33

回答

0

我猜你已经编辑了错误的php.ini

我不如果是在你的机器的情况下,至少在我,有四个目录在/ etc/php5 /文件夹中:/ apache2,/ apache2fiter,/ cli;有时你需要编辑php.ini文件/ apache2filter文件夹下激活Xdebug的〜希望工程

3

找出第一个从那里你的php.ini是在Ubuntu流动的命令行调用:

php -i |grep "php.ini" 

您可以测试的XDebug它正在与一个PHP文件如下因素代码:

<?php 
function test(){ 
    echo "Called @ ".xdebug_call_file(). 
    ":".xdebug_call_line()." from". 
    xdebug_call_function(); 
} 
test(); 

>

和运行这样的脚本: PHP -e myphpfile.php

你会得到这样的:从{}主根@ Magento的b

好运

相关问题