dou47732 2014-05-14 10:39
浏览 52
已采纳

在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 "
 response = 
";
    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"
  • 写回答

1条回答 默认 最新

  • doubiao7267 2014-05-14 10:45
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于知识的学以致用的解释
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败