php 在控制台中出错:无法加载资源:net::ERR_CONNECTION_RESET
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24931566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Getting error in console : Failed to load resource: net::ERR_CONNECTION_RESET
提问by DLV
I have refresh my application page and getting this error in console
Failed to load resource: net::ERR_CONNECTION_RESET
.
我刷新了我的应用程序页面并在控制台中收到此错误
Failed to load resource: net::ERR_CONNECTION_RESET
。
I have tried to re-install the XAMPP version but this doesnt work for me.
我曾尝试重新安装 XAMPP 版本,但这对我不起作用。
采纳答案by Avinash Babu
回答by Willy Anjaya
I'm using chrome too and facing same problem on my localhost. I did a lot of things like clear using CCleaner and restart OS. But my problem was solved with clearing cookie. In order to clear cookie:
我也在使用 chrome 并在我的本地主机上面临同样的问题。我做了很多事情,比如使用 CCleaner 清除并重新启动操作系统。但是我的问题通过清除 cookie 解决了。为了清除cookie:
- Go to Chrome settings > Privacy > Content Settings > Cookie > All cookie and Site Data > Delete domain problem
- 转到 Chrome 设置 > 隐私 > 内容设置 > Cookie > 所有 cookie 和站点数据 > 删除域问题
OR
或者
- Right Click > Inspect Element > Tab Resources > Cookie (Left Menu) > Select domain > Delete All cookie One By One (Right Menu)
- 右键单击> 检查元素> 选项卡资源> Cookie(左菜单)> 选择域> 一一删除所有cookie(右菜单)
回答by Wilt
I had a similar issue using Apache 2.4 and PHP 7.
我在使用 Apache 2.4 和 PHP 7 时遇到了类似的问题。
My client sent a lot of requests when refreshing (hard reloading) my application page in the browser and every time some of the last requests resulted in this error in console:
我的客户端在浏览器中刷新(硬重新加载)我的应用程序页面时发送了很多请求,并且每次最后的一些请求都会在控制台中导致此错误:
GET
http://example.com/api/v1/my/resource
net::ERR_CONNECTION_RESET
获取
http://example.com/api/v1/my/resource
网络::ERR_CONNECTION_RESET
It turned out that my client was reaching the maximum amount of threads that was allowed. The threads exceeding this configured ceiling are simply not handled by Apache at all resulting in the connection reset error response.
结果是我的客户端达到了允许的最大线程数。超过此配置上限的线程根本不会由 Apache 处理,从而导致连接重置错误响应。
The amount of threads can be easily raised by setting the ThreadsPerChild
value for the module in question.
The easiest way to make such change is to uncomment the Server-pool management config file conf/extra/httpd-mpm.conf
and then editing the preset values in the file to desired values.
通过设置ThreadsPerChild
相关模块的值,可以轻松增加线程数量。
进行此类更改的最简单方法是取消对服务器池管理配置文件的注释conf/extra/httpd-mpm.conf
,然后将文件中的预设值编辑为所需的值。
1) Uncomment the Server-pool management file
1)取消对Server-pool管理文件的注释
# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf
2) Open and edit the file conf/extra/httpd-mpm.conf
and raise the amount of threads
2) 打开并编辑文件conf/extra/httpd-mpm.conf
并增加线程数
In my case I had to change the threads for the mpm_winnt_module
:
就我而言,我不得不更改以下线程mpm_winnt_module
:
# raised the amount of threads for mpm_winnt_module to 250
<IfModule mpm_winnt_module>
ThreadsPerChild 250
MaxConnectionsPerChild 0
</IfModule>
A comprehensive explanation on these Server-pool management configuration settings can be found in this post on StackOverflow.
可以在 StackOverflow 上的这篇文章中找到有关这些服务器池管理配置设置的全面说明。
回答by emanresu
Try it with the browser in incognito mode first. If incognito works it's probably an extension or settings issue with the browser(s) and not a server issue. Hopefully this saves someone the headache I just went through.
首先在隐身模式下使用浏览器尝试。如果隐身模式有效,则可能是浏览器的扩展或设置问题,而不是服务器问题。希望这可以避免我刚刚经历的头痛。
回答by paaacman
I had the same error with Symfony on wamp and PHP 7.0.0.
我在 wamp 和 PHP 7.0.0 上使用 Symfony 时遇到了同样的错误。
symptoms
症状
None of the JS and CSS dependencies was loaded on the "dev" environnement, with error Failed to load resource: net::ERR_CONNECTION_RESET
在“开发”环境中没有加载任何 JS 和 CSS 依赖项,出现错误 Failed to load resource: net::ERR_CONNECTION_RESET
solution
解决方案
It's effectively a certificate problem in php.ini
.
You need to set the property curl.cainfo
to a valid certificate in the line :
它实际上是php.ini
. 您需要将该属性设置curl.cainfo
为行中的有效证书:
curl.cainfo = C:\your\wamp\path\bin\cacert\cacert.pem
回答by user7630000
Turning off my VPN resolved the issue.
关闭我的 VPN 解决了这个问题。
回答by Drew Delano
For me, this error was happening on localhost, but it disappeared when routing it through ngrok and was replaced with a MUCH more helpful error (net::ERR_INCOMPLETE_CHUNKED_ENCODING) that led me here:
对我来说,这个错误发生在本地主机上,但是在通过 ngrok 路由它时它消失了,并被一个更有帮助的错误 (net::ERR_INCOMPLETE_CHUNKED_ENCODING) 取代,导致我来到这里:
https://stackoverflow.com/a/29969400
https://stackoverflow.com/a/29969400
Basically, the Kestrel server I was using was saying it was chunked output, but not terminating it properly. I double checked it with Fiddler which confirmed the error.
基本上,我使用的 Kestrel 服务器说它是分块输出,但没有正确终止它。我用 Fiddler 仔细检查了它,确认了错误。
回答by Hamit YILDIRIM
In my case i have used .woff files from git repository, and i noticed git has changed my binary files. That with some null character at the file endings. I have rechanged to the orgnal .woff source files and it has corrected!
就我而言,我使用了 git 存储库中的 .woff 文件,我注意到 git 更改了我的二进制文件。在文件结尾处带有一些空字符。我已更改为 orgnal .woff 源文件,并且已更正!
Also i have understood visual studio controller sending corrupted error like ERR_CONNECTION_RESET from the controller when it gots null character
此外,我还了解 Visual Studio 控制器在获取空字符时从控制器发送损坏的错误,例如 ERR_CONNECTION_RESET
I shared for all who live this problem
我分享给所有遇到这个问题的人