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

commandantp's avatar

All cURL calls fail with error 6: Could not resolve host - suddenly on Production server only

Hey guys, Thanks for reading. All the cURL call are failing on my production server but none on test/staging servers. At first I thought it was something with Socialite but now even the Send Mail doesn't work. Here is an example of the errors I get:

Error executing "SendRawEmail" on "https://email.eu-west-1.amazonaws.com"; AWS HTTP error: cURL error 6: Could not resolve host: email.eu-west-1.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html

Same problem with facebook.com / google.com / stripe.com .... Any idea on what I could check / what could go wrong ? I've been browsing around looking for an answer with no success :(

Thanks a lot!

0 likes
10 replies
bobbybouwmann's avatar

You need to restart your server. There was a problem with libc and it was patched automatically. To solve it you simply need to restart the server so all changes will be applied ;)

1 like
bobbybouwmann's avatar

Yeah, AWS is applying security updates automatically. I believe you can turn this option off. It's up to you to do so ;)

pspwebtech's avatar

Hi. We are getting the same issue with at least three of our servers ( all build with Laravel Forge, don't think it's coming from it though because saw someone with Wordpress setup to complaint about the same issue). Restarting the php-fpm is solving the problem but just got a regression on one of the servers and issue appears again (that one was completely restarted). Could anyone elaborate on this one? Thank you.

pspwebtech's avatar
Level 6

Ah. Yeah, you can see the automatic security updates of Ubuntu - 'sudo nano /var/log/dpkg.log' . It affects the getaddress functions which CURL is using. They have roll out a few updates ( https://launchpad.net/ubuntu/xenial/amd64/libc-bin )

The bug - https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1674532

Make sure to update to latest fixed version. -

For Ubuntu xenial is 
2.23-0ubuntu7
For Trusy
2.19-0ubuntu6.11
sudo apt-get update

sudo apt-get install --upgrade libc-bin libc-dev-bin libc6 libc6-dev klibc-utils libklibc

sudo reboot
4 likes
commandantp's avatar

@pspwebtech Thanks man! It fixed the problem! Any way we can prevent having to do that everytime / discovering it too late?

1 like
yuca's avatar

I had the problem yesterday (21 march) and it was solved with a full restart of the server (Ubuntu).

Today (22 march), i AGAIN had the problem (solved again by a reboot). @pspwebtech : I see that there are 2 updates of libc : one yesterday, and one today (https://launchpad.net/ubuntu/xenial/amd64/libc-bin).

Do you think that this means that 2 reboot where needed ? I'm worried about this happening again.

igorblumberg's avatar

Hello, I had this error yesterday (march 21st) morning. I restarted the server and everything worked.

Today (march 22nd) the error happened again. I restarted the server and it's working.

I've updated the libc as @pspwebtech suggested. I will return tomorrow with the result :D

2 likes
pspwebtech's avatar

@igorblumberg same thing for me. I think it's gonna be fine if you got the latest version of the problematic packet. Still we better be monitoring it. Also I think this will backfire to other services. Actually Laravel Forge is not working for me at the moment and I won't be surprised if this is related.

@commandantp you can write some automatic command which can send you reports about latest automatic updates on your server. Can read them from '/var/log/dpkg.log' . Or you can disable all the automatic updates. Usually only the security ones are automatic.

ucreate.it's avatar

Thanks @pspwebtech, it's working for me. But it needs to restart the server instead of reboot the machine.

Please or to participate in this conversation.