Hello, community. The situation is as follows. With an ajax request, the response from the server comes in at least 2 lines, where the first line is always a colon ":". I tried to find an answer in the Internet but found nothing similar. Maybe I didn’t get it ... Why is this happening and what can it be connected with? How to be treated? On the local machine, the answers come in normally, i.e. without colons.

PHP 7.0.30, nginx 1.10.3

  • Dear, and what kind of server, what language is it? Perhaps there is not enough data on it or is it sending you something extra? In theory, you need to look at his code. - sirWill
  • PHP 7.0.30, nginx 1.10.3. On the server, the application has been working for a long time, and so there are no problems, it is ticking like a Swiss watch. The problem is exactly ajax requests. Now it’s noticed that he returns the pieces of html correctly, but on this echo '123' or echo json_encode (['123']) returns like this 1 line -: 2 line - 123 - Nikolay.B
  • Kohl, you need to look at the server code and dig there. Client request has nothing to do with it. I sent a request to the server - I received a response. And that in the answer - forms the server. And it doesn't matter if the server is running - wp, laravel, django or just mail.php . Learn server code. - Maxim K
  • Maxim, thanks for the answer. There are admins for this with us. Now I know who I need to get - Nikolay.B

1 answer 1

This behavior was the cause of the server update, specifically apach2 and php. Unfortunately there is no data on versions, admins did not provide. After the rollback of versions to previous ones, everything fell into place.