It depends on if you're using a SOAP or REST API, but both the PHP SoapClient and cURL libraries support proxies.
For SoapClient, the documentation states:
For HTTP authentication, the login and password options can be used to
supply credentials. For making an HTTP connection through a proxy
server, the options proxy_host, proxy_port, proxy_login and
proxy_password are also available. For HTTPS client certificate
authentication use local_cert and passphrase options. An
authentication may be supplied in the authentication option. The
authentication method may be either SOAP_AUTHENTICATION_BASIC
(default) or SOAP_AUTHENTICATION_DIGEST.
For example, this is a simplified extract from some sample code connecting to Salesforce using SOAP:
$soapOptions = array();
$soapOptions['proxy_host'] = "localhost";
$soapOptions['proxy_port'] = (int) 8080; // Use an integer, not a string
$soapOptions['proxy_login'] = "username";
$soapOptions['proxy_password'] = "password";
$this->sforce = new SoapClient($wsdlPath, $soapOptions);
For cURL, take a look at the curl_setopt documentation, which has several options for proxies. Here is a simplified extract from some sample code connecting to Salesforce using REST:
$ch = curl_init();
...
curl_setopt($ch, CURLOPT_PROXY, "localhost");
curl_setopt($ch, CURLOPT_PROXYPORT, 8080);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password");
$chResponse = curl_exec($ch);