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

lindstrom's avatar

Task Hook thenPing Guzzle Error

I have a scheduled command that looks like this:

$schedule->command('monitor')
    ->cron('5,20,35,50 * * * *')
    ->thenPing('http://beats.envoyer.io/heartbeat/beatidentifier');

When the command is called, firing thenPing results in the following error:

production.ERROR: GuzzleHttp\Exception\RequestException: cURL error 1: Protocol "_http" not supported or disabled in libcurl (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /home/forge/monitor/releases/20160505204832/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:187

Of course there is no _http protocol so it looks like something is happening to the URL as it gets passed to Guzzle. Has anyone seen this before? This is on a Forge server provisioned the day before yesterday. Installed packages look good.

To workaround, one can pass a closure to the after() hook and use curl, but I'd like to figure out what's going on with thenPing/Guzzle.

The workaround:

$schedule->command('monitor')
    ->cron('5,20,35,50 * * * *')
    ->after(function () {
        $ch = curl_init('http://beats.envoyer.io/heartbeat/beatidentifier');
         curl_exec($curl);
         curl_close($curl);
         });
0 likes
0 replies

Please or to participate in this conversation.