[php-src] Issue #22246: Unable to use UNIX socket for PROXY

[email protected] (utouchgrass) Sun, 7 Jun 2026 08:17:48 +0000
Newsgroups php.bugs
Message-ID <JIzlORBG9nvlkrqcOJBgDoTIiurayeLmM7IXNuEOwXE@main.internal.php.net>
Issue: https://github.com/php/php-src/issues/22246
Author: utouchgrass

### Description

The following code:

```php
<?php
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,'https://github.com/');
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_VERBOSE,1);
curl_setopt($ch,CURLOPT_HTTPPROXYTUNNEL,1);
curl_setopt($ch,CURLOPT_PROXY,'socks5h://localhost/run/proxy.sock');// "/run/proxy.sock" does exist as socket
curl_setopt($ch,CURLOPT_PROXYTYPE,CURLPROXY_SOCKS5_HOSTNAME);
var_dump(curl_exec($ch));
```

Resulted in this output:
```
bool(false)
```

But I expected this output instead:
```
* curl debug output
```

Also read: https://curl.se/libcurl/c/CURLOPT_PROXY.html
 "Unix domain sockets are supported for SOCKS proxies."

### PHP Version

```plain
PHP 8.4.21 (cli) (built: May  8 2026 05:56:48) (NTS)
```

### Operating System

Ubuntu