When selecting a Guzzle client's handler deliberately, a cURL-backed stack can use SOCKS:

$stack = \GuzzleHttp\HandlerStack::create(
    new \GuzzleHttp\Handler\CurlHandler()
);

$client = new \GuzzleHttp\Client([
    'handler' => $stack,
    'proxy' => 'socks5h://proxy.example.net:1080',
]);

socks5h asks the proxy to resolve the destination name. Guzzle passes the endpoint to libcurl, so the loaded libcurl build must support that protocol. The SOCKS5 proxy list supplies public endpoint candidates for the client proxy URL.

If the application already owns a handler stack, inspect its underlying transport before replacing it and losing middleware. A handler limited to PHP HTTP streams cannot implement SOCKS merely because the client receives this option.

Check the process making the request. CLI PHP and PHP-FPM can load different configuration files and extensions; cURL appearing in one does not establish its availability in the other.

Artiglyn mynjee