Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amitsolanki24_'s avatar

How can i fix PHP curl error

Error: call to URL failed with status 0, response , curl_error Empty reply from server, curl_errno 52

This error is occurring on production not on local environment. My backend and frontend server domains are different.

Error image https://jmp.sh/uDfkBeEh

0 likes
2 replies
Merklin's avatar
  1. This can happen if curl is asked to do plain HTTP on a server that does HTTPS. For example, if you call curl http://google.com:443

  2. On other hand, there could be a firewall or a proxy on your production server that blocks the request.

  3. If you are suing some kind of authentication i.e. calling an API, check if the security key/code is not linked to a particular domain. I.e. you may need one key for local and generate another key for producton.

amitsolanki24_'s avatar

@Merklin I don't know why it's showing this problem with only single api other my post get patch apis are working fine if there is a firewall or security issue than none of the apis work

Please or to participate in this conversation.