ERR_CONNECTION_RESET与symfony2但不与PHP脚本 [英] ERR_CONNECTION_RESET with symfony2 but not with PHP script

查看:172
本文介绍了ERR_CONNECTION_RESET与symfony2但不与PHP脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Symfony开发一个Web应用程序,该应用程序应该连接到远程Web服务。然后将数据库从客户端同步到服务器,反之亦然和其他一些废话。

I am currently developing a web application with Symfony that's supposed to connect to a remote Web-Service. Then synchronise database from the client to the server and vice-versa and some other crap.

Web服务服务器位于LAN中的IIS上。
Symfony2在我的机器上运行Wamp。

The Web-service server is on an IIS in the LAN. Symfony2 is running with Wamp on my machine.

因此,简单的PHP脚本中的Web服务连接和请求代码功能完备。或者至少,它做我想做的事。
与IIS服务器的任何连接都非常好。
但有点慢,但机器很乱。

So, the connexion and request code to the web-service in a simple php script is perfectly functional. Or at least, it does what I want it to do. And any connexion to the IIS server is perfectly fine. A bit slow though, but the machine is quite a mess.

现在我将相同的代码放入Symfony2类,这就是地狱。
当我尝试加载该页面时,我得到一个

Now I put that same code into a Symfony2 class, and here comes the hell. When I try to load that page, I get a


101错误(ERR_CONNECTION_RESET)

101 error (ERR_CONNECTION_RESET)

Web服务服务器的日志表明我已发送登录,请求和响应。
所以我的猜测是问题来自于我的机器,但不太确定。

Web-service server's log indicates me that the login, request and response were sent. So my guess is the problem is comin' from my machine, but not quite sure about it.

非常有趣的事情:我以某种方式设法做到了工作约10次。
然后101再次...

The really funny thing : I somehow managed to make it work for about 10 times. Then 101 again...

我禁用了Windows 7局域网防火墙两侧,结果相同。

I disabled the Windows 7 LAN firewall both side, same result.

任何线索都非常受欢迎。
谢谢。

Any clue is very welcome. Thanks.

推荐答案

我花了几个小时和一位同事一起调试。他得到了同样的错误,但它在我的机器上正常工作(我们使用的是Windows 7,64位,WAMPServer 2.2d,32位)。


以下是罪魁祸首:


- 文件TwigEngine.php在我的机器上有Unix风格的行尾(LF)但是在他的机器上它有Windows风格的行结尾(CR + LF)


- 在将行结尾改为LF之后,它在他的机器上工作正常

I spent hours debugging this with a colleague. He was getting the same error but it was working properly on my machine (we're using Windows 7, 64bit, WAMPServer 2.2d, 32bit).
Here is what the culprit was:
- the file TwigEngine.php had Unix-style line endings (LF) on my machine but on his machine it had Windows-style line endings (CR+LF)
- after changing the line endings to LF only, it works fine on his machine too

这将可能解释上述所有我需要做的就是重新保存
TwigBundle / TwigEngine.php如果编辑器改了行结尾的格式对方的回答。

That would possibly explain the other answer above "all I needed to do is just resave TwigBundle/TwigEngine.php" if the editor changed the format of the line endings.

根本原因是安装了git,他选择了默认(Windows式检查)并且我选择了原样。)

The underlying cause was the installation of git, he had picked the default ("Windows-style check-outs") and I had selected "as-is").

经过一番研究。这里是导致这种的解释: https://github.com/symfony/symfony/issues / 3216

After some more research. here is an explanation of the cause for this: https://github.com/symfony/symfony/issues/3216

希望这可以帮助别人节省一些时间。

Hopefully this helps someone else save some time.

这篇关于ERR_CONNECTION_RESET与symfony2但不与PHP脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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