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

ahmeda's avatar

Timeout with Guzzle!?

I have this code just to call an SMS service via Laravel Http:

$respone = Http::acceptJson()->post(
            'https://www.XXXXX.com/gw/sendsms.php',
            [
                "userName" => config('sms.sms_user'),
                "numbers" => $number,
                "userSender" => config('sms.sms_user_sender'),
                "apiKey" => config('sms.sms_api_key'),
                "msg" => $msg
            ]
        )->json();

This code works locally perfectly. but once I deploy this code on the server I got a timeout!

I'm using AWS EB PHP 8.1 running on 64bit Amazon Linux 2/3.4.0

When I SSH on the server and use CURL to the same URL, it takes like infinite time to return and no response back!

To make sure, I create another micro server on EC2 and use CURL to the same URL service here I got a response!

I have other services also I'm using HTTP Laravel for them and they are working just fine!

I do not what is the problem! everything in the app is working except this service!

0 likes
5 replies
vincent15000's avatar

Perhaps something wrong with a firewall in production ?

1 like
Sinnbeck's avatar

Maybe the ip of the server that isn't working either has a routing error or is blocked

1 like
ahmeda's avatar

@Sinnbeck I think there is something not normal in EB service! Cuz I create another EB server and deploy just above code without any other code and still go timeout! But use this HTTP in ec2 without EB my service is just working fine! And I got response!

Niush's avatar

Check the Outbound Rules of Security Groups linked to that EB instance. May be the rule was modified and is blocking.

1 like

Please or to participate in this conversation.