ERR_CONNECTION_RESET with symfony2, but not with PHP script

I am currently developing a web application with Symfony that should connect to a remote web service. Then sync the database from client to server and vice versa and some other crap.

The web service server is located in IIS on the local network. Symfony2 works with Wamp on my machine.

Thus, the communication code and the request to the web service in a simple PHP script works fine. Or at least he does what I want. And any connection to the IIS server is excellent. A bit slow though, but the car is quite a mess.

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

101 errors (ERR_CONNECTION_RESET)

The web service server log indicates to me that the login, request and response have been sent. Therefore, I assume that the problem is related to my car, but I’m not quite sure about it.

The funny thing is: I somehow managed to get it to work about 10 times. Then 101 again ...

I disabled the Windows 7 LAN firewall and the same result.

Any hint is greatly appreciated. Thanks.

+3
source share
5 answers

I spent hours debugging this with a colleague. He had the same error, but it worked correctly on my machine (we use Windows 7, 64 bit, WAMPServer 2.2d, 32 bit).
Here is the culprit:
- the TwigEngine.php file had Unix-style line endings (LF) on my machine, but Windows-style lines (CR + LF) were completed on his machine
- after changing the line endings only on LF, he works great on his machine.

This might explain the other answer above β€œall I have to do is just reinstall TwigBundle / TwigEngine.php” if the editor has changed the format of the line endings.

The main reason was installing git, it chose the default value ("Windows-style checks"), and I chose "as-is").

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

Hope this helps someone else save time.

+3
source

I solve the problem ...

I set the second AppKernel parameter in app_dev.php to FALSE and now works fine

$kernel = new AppKernel('dev', FALSE); 

I will continue the investigation ...

0
source

I had the same problem after 4 hours of "debugging", I found that all I need to do is just save

TwigBundle / TwigEngine.php

I do not know why

0
source

In fact, I think (in my case, at least) these errors are twisted. Sometimes, when a critical error occurs associated with a branch registered in the /logs/dev.log application, I get this 101. These critical errors are often syntactical, so there are no real transactions here. And once they are reviewed, there are no more problems.

The strange thing is that sometimes clearing the cache allows me to load a page 3 or 4 times.

0
source

Mike RP did it. TwigEngine requires LF line endings to function properly. You can use this console command, then you have to update / reinstall suppliers.

git config --global core.autocrlf input

0
source

Source: https://habr.com/ru/post/1394102/


All Articles