在NetBeans上使用XDebug进行卷曲 [英] Curl with XDebug on NetBeans

查看:138
本文介绍了在NetBeans上使用XDebug进行卷曲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,当试图调试与Netbeans上的Xdebug(在Windows 8)curl请求。
这是我的代码:

  $ ch = curl_init 
curl_setopt($ ch,CURLOPT_URL,http:// localhost);
curl_setopt($ ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ ch,CURLOPT_TIMEOUT,10);
curl_setopt($ ch,CURLOPT_FOLLOWLOCATION,true);

$ response = curl_exec($ ch);
if(curl_errno($ ch)){
$ result ='ERROR - > '。 curl_errno($ ch)。 ':'。 curl_error($ ch);
echo $ result;
}

print\\\
response = \\\
;
var_dump($ response);

//关闭cURL资源,释放系统资源
curl_close($ ch);

die;当我使用Netbeans调试时,我得到:


pre> 错误 - > 28:操作在10015毫秒后超时-1个字节,超过-1个字节receivedresponse = bool(false)

当我运行没有调试,我没有错误和一个xampp页面的响应。



在php.ini我有:

  [XDebug] 
zend_extension =C:\xampp\php\ext\php_xdebug-2.2.5-5.4-vc9.dll
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir =C:\xampp\tmp
xdebug。 profiler_output_name =cachegrind.out。%t-%s
xdebug.remote_enable = 1
xdebug.remote_handler =dbgp
xdebug.remote_autostart = 1
xdebug.remote_host = 127.0.0.1
xdebug.remote_port =9000
xdebug.trace_output_dir =C:\xampp\tmp
xdebug.max_nesting_level = 200
xdebug.idekey =netbeans-xdebug


解决方案

设置 xdebug.remote_autostart = 1 ,Xdebug将始终尝试启动远程调试会话并尝试连接到客户端(即使GET / POST / COOKIE变量不存在)。



可能是,在你的情况下,Xdebug尝试连接Netbeans但无法完成操作,这导致Xdebug到操作超时错误。


I have a strange problem when trying to debug with Xdebug on Netbeans ( on Windows 8 ) a curl request. Here is my code:

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://localhost");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

    $response = curl_exec($ch);
    if ( curl_errno($ch) ) {
        $result = 'ERROR -> ' . curl_errno($ch) . ': ' . curl_error($ch);
        echo $result;
    }

    print "\n response = \n";
    var_dump($response);

    // close cURL resource, and free up system resources
    curl_close($ch);

    die;

When I debug with Netbeans I get:

ERROR -> 28: Operation timed out after 10015 milliseconds with 0 out of -1 bytes  receivedresponse = bool(false)

When I just run without debug I get no error and a response of a xampp page.

In php.ini I have:

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.5-5.4-vc9.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0 
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_autostart = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = "9000"
xdebug.trace_output_dir = "C:\xampp\tmp"
xdebug.max_nesting_level = 200
xdebug.idekey = "netbeans-xdebug"

解决方案

I suppose that when you set xdebug.remote_autostart = 1, Xdebug will always attempt to start a remote debugging session and try to connect to a client (even if the GET/POST/COOKIE variable was not present).

May be, in your case, Xdebug try to connect Netbeans but is unable to complete the operation, which this lead Xdebug to Operation timeout error.

这篇关于在NetBeans上使用XDebug进行卷曲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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