Proxy in PHP cURL: three options
In PHP cURL a password proxy takes three options. Below is a script for HTTP and a one-line switch to SOCKS5.

Why use a proxy in PHP cURL
PHP's cURL extension runs on top of libcurl. The proxy address is set with CURLOPT_PROXY, login and password with CURLOPT_PROXYUSERPWD, the type with CURLOPT_PROXYTYPE. HTTP and SOCKS4/5 are supported.
HTTP is enough for web requests. If you need SOCKS5, use the CURLPROXY_SOCKS5_HOSTNAME type so the proxy resolves the domain. Rotation suits scraping, a sticky session a chain of requests by one user.
Residential
from $0.6 / GBHome ISP addresses. The main choice for accounts and protected sites.
VIP
$2 / GBHand-picked clean IPs, faster and more stable than regular residential.
Mobile
$4 / GBCarrier IPs, for platforms that check addresses strictly.
Step-by-step setup
Button names are given exactly as they appear in PHP cURL.
Check the extension
Run php -m and look for curl in the list. If it's missing, install the php-curl package for your PHP version.
Export the proxy
Take host, port, login and password in @SousProxyBot or the dashboard.
Set the options
CURLOPT_PROXY is host and port, CURLOPT_PROXYUSERPWD is LOGIN:PASSWORD, CURLOPT_PROXYTYPE is CURLPROXY_HTTP or CURLPROXY_SOCKS5_HOSTNAME.
Run it
Save the example as ip.php and run php ip.php.
Check the IP
The script prints JSON with the proxy address. On error, curl_error shows the text.
Code example
Put in your own HOST, PORT, LOGIN and PASSWORD from the bot or the dashboard.
<?php
$ch = curl_init('https://api.ipify.org?format=json');
curl_setopt_array($ch, [
CURLOPT_PROXY => 'HOST:PORT',
CURLOPT_PROXYUSERPWD => 'LOGIN:PASSWORD',
CURLOPT_PROXYTYPE => CURLPROXY_HTTP, // SOCKS5: CURLPROXY_SOCKS5_HOSTNAME
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15,
]);
$body = curl_exec($ch);
if ($body === false) {
echo 'Error: ' . curl_error($ch) . PHP_EOL;
} else {
echo $body . PHP_EOL;
}
curl_close($ch);
Tested by running it
We ran this example ourselves: PHP 8.3.6 · ext-curl (libcurl 8.5.0). Real output below, IP hidden.
$ php ip.php {"ip":"proxy IP"}
And this is the response when the password is wrong:
$ php ip.php
Error: CONNECT tunnel failed, response 407Check that it works
Open these pages through PHP cURL with the proxy on.
Common errors
The issues people most often bring to support.
Call to undefined function curl_init()The cURL extension isn't loaded. Install php-curl and restart PHP-FPM or the web server.
407 response from the proxyCheck CURLOPT_PROXYUSERPWD: LOGIN:PASSWORD without spaces. A colon in the login breaks parsing.
Site sees your DNS with SOCKS5CURLPROXY_SOCKS5 resolves names locally. Replace it with CURLPROXY_SOCKS5_HOSTNAME.
Operation timed outWrong port or a slow IP. Compare the details in the dashboard and test the proxy on /en/tools/proxy-checker/.
FAQ
Can I pass everything in one string?
Yes, libcurl accepts http://LOGIN:PASSWORD@HOST:PORT or socks5h://LOGIN:PASSWORD@HOST:PORT in CURLOPT_PROXY. Then CURLOPT_PROXYUSERPWD and CURLOPT_PROXYTYPE aren't needed.
Do I change anything for HTTPS sites?
No, cURL opens a CONNECT tunnel through the HTTP proxy by itself.
How do I check rotation?
Run the script several times. With rotation the IP changes; with a sticky session it stays the same.
