<legend id='ZcgIZ'><style id='ZcgIZ'><dir id='ZcgIZ'><q id='ZcgIZ'></q></dir></style></legend>

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

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

    1. 为什么 file_get_contents 可用于 google.com 而不能用于我的网站?

      Why does file_get_contents work with google.com but not with my site?(为什么 file_get_contents 可用于 google.com 而不能用于我的网站?)
      <i id='lflsJ'><tr id='lflsJ'><dt id='lflsJ'><q id='lflsJ'><span id='lflsJ'><b id='lflsJ'><form id='lflsJ'><ins id='lflsJ'></ins><ul id='lflsJ'></ul><sub id='lflsJ'></sub></form><legend id='lflsJ'></legend><bdo id='lflsJ'><pre id='lflsJ'><center id='lflsJ'></center></pre></bdo></b><th id='lflsJ'></th></span></q></dt></tr></i><div id='lflsJ'><tfoot id='lflsJ'></tfoot><dl id='lflsJ'><fieldset id='lflsJ'></fieldset></dl></div>

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

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

        <tfoot id='lflsJ'></tfoot><legend id='lflsJ'><style id='lflsJ'><dir id='lflsJ'><q id='lflsJ'></q></dir></style></legend>

              <tbody id='lflsJ'></tbody>

              1. 本文介绍了为什么 file_get_contents 可用于 google.com 而不能用于我的网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                $page1 = file_get_contents('http://www.google.com');
                
                $page2 = file_get_contents('http://localhost:8000/prueba');
                

                当我回显结果时,在 Google 上它可以工作,但在我的网站上却不起作用.当我把地址放在资源管理器上时.这发生在我在 django 中制作的所有网站上.:(

                When I echo the results, with Google it works but not with my site. And when I put the address on the explorer works. And this happen with all the site that i make in django. :(

                警告:file_get_contents(http://localhost:8000/prueba) [function.file-get-contents]:无法打开流:连接尝试失败,因为连接方没有正确一段时间后响应,或建立连接失败,因为连接的主机没有响应.在 C:xampphtdocssquirrelmailpluginscaptchaackends2evo2evo.php 第 138 行

                Warning: file_get_contents(http://localhost:8000/prueba) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:xampphtdocssquirrelmailpluginscaptchaackends2evo2evo.php on line 138

                致命错误:第 138 行 C:xampphtdocssquirrelmailpluginscaptchaackends2evo2evo.php 中的最大执行时间超过 60 秒

                Fatal error: Maximum execution time of 60 seconds exceeded in C:xampphtdocssquirrelmailpluginscaptchaackends2evo2evo.php on line 138

                推荐答案

                对于使用 PHP 内置 Web 服务器(在我的情况下使用 Laravel)遇到此问题的任何人,这是由于您的请求被 file_get_contents()/卷曲函数.

                For anyone having this problem using PHP Built-in web server (with Laravel in my case), it is caused by your request being blocked by file_get_contents() / curl functions.

                文档 开发服务器说

                如果请求被阻止,PHP 应用程序将停止.

                PHP applications will stall if a request is blocked.

                由于PHP内置服务器是单线程的,在你的服务器上请求另一个url将停止第一个请求并超时.

                Since the PHP built-in server is single threaded, requesting another url on your server will halt first request and it gets timed out.

                作为解决方案,您可以使用适当的网络服务器(nginx、apache 等).

                As a solution, you can use proper web server (nginx, apache etc.).

                到目前为止,我真的建议您使用 Laravel Sail 作为 PHP 项目的开发环境.它为您设置和配置不同服务(网络服务器、数据库、队列等)节省了大量时间.

                As of now, I really suggest you to use Laravel Sail as a development environment for PHP projects. It saves you lots of time with setup and configuration of different services (webserver, databases, queues, etc.).

                这篇关于为什么 file_get_contents 可用于 google.com 而不能用于我的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tbody id='NB0Do'></tbody>
                  <i id='NB0Do'><tr id='NB0Do'><dt id='NB0Do'><q id='NB0Do'><span id='NB0Do'><b id='NB0Do'><form id='NB0Do'><ins id='NB0Do'></ins><ul id='NB0Do'></ul><sub id='NB0Do'></sub></form><legend id='NB0Do'></legend><bdo id='NB0Do'><pre id='NB0Do'><center id='NB0Do'></center></pre></bdo></b><th id='NB0Do'></th></span></q></dt></tr></i><div id='NB0Do'><tfoot id='NB0Do'></tfoot><dl id='NB0Do'><fieldset id='NB0Do'></fieldset></dl></div>
                  <legend id='NB0Do'><style id='NB0Do'><dir id='NB0Do'><q id='NB0Do'></q></dir></style></legend>

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

                        <bdo id='NB0Do'></bdo><ul id='NB0Do'></ul>
                      • <tfoot id='NB0Do'></tfoot>