• <small id='TpnKk'></small><noframes id='TpnKk'>

  • <tfoot id='TpnKk'></tfoot>

        <bdo id='TpnKk'></bdo><ul id='TpnKk'></ul>
    1. <i id='TpnKk'><tr id='TpnKk'><dt id='TpnKk'><q id='TpnKk'><span id='TpnKk'><b id='TpnKk'><form id='TpnKk'><ins id='TpnKk'></ins><ul id='TpnKk'></ul><sub id='TpnKk'></sub></form><legend id='TpnKk'></legend><bdo id='TpnKk'><pre id='TpnKk'><center id='TpnKk'></center></pre></bdo></b><th id='TpnKk'></th></span></q></dt></tr></i><div id='TpnKk'><tfoot id='TpnKk'></tfoot><dl id='TpnKk'><fieldset id='TpnKk'></fieldset></dl></div>
      <legend id='TpnKk'><style id='TpnKk'><dir id='TpnKk'><q id='TpnKk'></q></dir></style></legend>

        如何找出 cURL 挂起且无响应的原因?

        How can I figure out why cURL is hanging and unresponsive?(如何找出 cURL 挂起且无响应的原因?)
        <legend id='p68qP'><style id='p68qP'><dir id='p68qP'><q id='p68qP'></q></dir></style></legend>

          • <small id='p68qP'></small><noframes id='p68qP'>

              <tbody id='p68qP'></tbody>
                <bdo id='p68qP'></bdo><ul id='p68qP'></ul>
                <i id='p68qP'><tr id='p68qP'><dt id='p68qP'><q id='p68qP'><span id='p68qP'><b id='p68qP'><form id='p68qP'><ins id='p68qP'></ins><ul id='p68qP'></ul><sub id='p68qP'></sub></form><legend id='p68qP'></legend><bdo id='p68qP'><pre id='p68qP'><center id='p68qP'></center></pre></bdo></b><th id='p68qP'></th></span></q></dt></tr></i><div id='p68qP'><tfoot id='p68qP'></tfoot><dl id='p68qP'><fieldset id='p68qP'></fieldset></dl></div>

                  <tfoot id='p68qP'></tfoot>
                1. 本文介绍了如何找出 cURL 挂起且无响应的原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试查找 PHP 中的 cURL 调用问题.它在我们的测试环境中运行良好,但在我们的生产环境中却不行.当我尝试执行 cURL 函数时,它只是挂起并且永远不会响应.我试过从命令行建立一个 cURL 连接,同样的事情发生了.

                  I am trying to track down an issue with a cURL call in PHP. It works fine in our test environment, but not in our production environment. When I try to execute the cURL function, it just hangs and never ever responds. I have tried making a cURL connection from the command line and the same thing happens.

                  我想知道 cURL 是否记录了某处正在发生的事情,因为我无法弄清楚在命令搅动和搅动期间发生了什么.有谁知道是否有记录那里发生的事情的日志?

                  I'm wondering if cURL logs what is happening somewhere, because I can't figure out what is happening during the time the command is churning and churning. Does anyone know if there is a log that tracks what is happening there?

                  我认为这是连接问题,但我们的 IT 人员坚持认为我应该能够毫无问题地访问它.有任何想法吗?我正在运行 CentOS 和 PHP 5.1.

                  I think it is connectivity issues, but our IT guy insists I should be able to access it without a problem. Any ideas? I'm running CentOS and PHP 5.1.

                  更新:使用详细模式时,我收到错误 28Connect() Timed Out".我尝试将超时时间延长到 100 秒,并将 max-redirs 限制为 5,没有变化.我尝试ping盒子,也有超时.因此,我将把它提交给 IT 部门,看看他们是否会再看一遍.感谢所有的帮助,希望我能在半小时后回来告诉他们这是他们的问题.

                  Updates: Using verbose mode, I've gotten an error 28 "Connect() Timed Out". I tried extending the timeout to 100 seconds, and limiting the max-redirs to 5, no change. I tried pinging the box, and also got a timeout. So I'm going to present this back to IT and see if they will look at it again. Thanks for all the help, hopefully I'll be back in a half-hour with news that it was their problem.

                  更新 2: 原来我的机器正在使用外部 IP 地址解析服务器名称.当 IT 给我内部 IP 地址并在 cURL 调用中替换它时,一切正常.感谢大家的帮助.

                  Update 2: Turns out my box was resolving the server name with the external IP address. When IT gave me the internal IP address and I replaced it in the cURL call, everything worked great. Thanks for all the help everybody.

                  推荐答案

                  在你的 php 中,你可以设置 CURLOPT_VERBOSE 变量:

                  In your php, you can set the CURLOPT_VERBOSE variable:

                  curl_setopt($curl, CURLOPT_VERBOSE, TRUE);
                  

                  然后记录到 STDERR,或使用 CURLOPT_STDERR 指定的文件(接受文件指针):

                  This then logs to STDERR, or to the file specified using CURLOPT_STDERR (which takes a file pointer):

                  curl_setopt($curl, CURLOPT_STDERR, $fp);
                  

                  从命令行,您可以使用以下开关:

                  From the command line, you can use the following switches:

                  • --verbose 向命令行报告更多信息
                  • --trace <file>--trace-ascii <file> 跟踪到文件
                  • --verbose to report more info to the command line
                  • --trace <file> or --trace-ascii <file> to trace to a file

                  您可以使用 --trace-time 将时间戳添加到详细/文件输出

                  You can use --trace-time to prepend time stamps to verbose/file outputs

                  这篇关于如何找出 cURL 挂起且无响应的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Converting string to MySQL timestamp format in php(在php中将字符串转换为MySQL时间戳格式)
                  datetime to timestamp(日期时间到时间戳)
                  PHP timestamp date to user timezone(PHP时间戳日期到用户时区)
                  Converting TIMESTAMP to unix time in PHP?(在 PHP 中将 TIMESTAMP 转换为 unix 时间?)
                  Convert ISO 8601 to unixtimestamp(将 ISO 8601 转换为 unixtimestamp)
                  Finding days between 2 unix timestamps in php(在php中查找2个unix时间戳之间的天数)

                  <small id='F4mXD'></small><noframes id='F4mXD'>

                    <tbody id='F4mXD'></tbody>
                2. <legend id='F4mXD'><style id='F4mXD'><dir id='F4mXD'><q id='F4mXD'></q></dir></style></legend>

                          <bdo id='F4mXD'></bdo><ul id='F4mXD'></ul>

                          <i id='F4mXD'><tr id='F4mXD'><dt id='F4mXD'><q id='F4mXD'><span id='F4mXD'><b id='F4mXD'><form id='F4mXD'><ins id='F4mXD'></ins><ul id='F4mXD'></ul><sub id='F4mXD'></sub></form><legend id='F4mXD'></legend><bdo id='F4mXD'><pre id='F4mXD'><center id='F4mXD'></center></pre></bdo></b><th id='F4mXD'></th></span></q></dt></tr></i><div id='F4mXD'><tfoot id='F4mXD'></tfoot><dl id='F4mXD'><fieldset id='F4mXD'></fieldset></dl></div>
                            <tfoot id='F4mXD'></tfoot>