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

_midhun's avatar

GuzzleHttp inside Job Not working

Guzzzle request not working inside Job Im getting this error

GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler. {"exception":"[object] (RuntimeException(code: 0): GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.

 public function handle()
    {

        // logger($this->webhookCall);
        
      $url = $this->apiURL.'/'.$this->storeId.'/products/'.$this->webhookCall['payload']['entityId'];

    
    
    try {
            $request = Http::withToken($this->token)
                ->get($url);
        } catch (ClientException $e) {
            echo
            $body = $e->getResponse()->getBody()->getContents();
            return $body;
        }
         logger($request->json());
        return ;
    }
0 likes
10 replies
sr57's avatar

@_midhun

seems you have not install curl

apt install php8.0-curl

1 like
_midhun's avatar

@sr57 no Its installed, it works on usual controller method, not working in insde a job

sr57's avatar

@_midhun

Have you look to any difference (regarding curl) in php.ini (web server and cli)?

1 like
_midhun's avatar

@sr57 after this exception i enabled the allow_url_fopen in php ini, but same error

sr57's avatar

@_midhun

I don't use it, but it seems that the curl_exec() and curl_multi_exec() functions can be both disabled in the PHP configuration of cpanel ...

1 like
_midhun's avatar

@sr57 But the the guzzle is working fine inside usual controller method, im getting the response

_midhun's avatar

let me check, Thanks for the reply

Please or to participate in this conversation.