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

lararocks's avatar

Guzzle Http "Connection refused" on shared hosting

Hello,

I'm using Guzzle Http to connect to an IP with port and get the desired response. Everything works fine on localhost XAMPP but when I make the call from shared hosting, I get the following message:

cURL error 7: Failed to connect to [IP NUMBER] port [PORT NUMBER]: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

Is that something with my shared hosting? or is it an issue from the IP/server itself? Thanks

0 likes
2 replies
automica's avatar
automica
Best Answer
Level 54

@lararocks if you check the logs for the error, what do you see?

Have you checked with your host that you are allowed to make curl calls from your shared server?

Are you missing any php extensions?

lararocks's avatar

Thanks. I contacted the hosting and they said it was an issue with the port and they fixed it.

1 like

Please or to participate in this conversation.