Using Proxy51 proxies with PHP/curl is one of the most common use cases. Below is some sample code for connecting to the proxies. If you are having trouble with your own code, check your settings against this code.

<?php

// Proxy credentials
$ip = '';
$port = '3131';
$username = '';
$password = '';

// A good test URL
$url = 'http://proxy51.com/php/ip_info.php';

/* END CONFIGURATION */

// Combine username and password
$userpass =$username . ':' . $password;

// Set up curl options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXYPORT, $port);
curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');
curl_setopt($ch, CURLOPT_PROXY, $ip);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $userpass);

// NOTE: DO NOT SET CURLOPT_HTTPPROXYTUNNEL. This causes problems.

// Load data and close
$data = curl_exec($ch);
curl_close($ch);

// Echo result
echo $data;

?>