Using PHP 5.2.6 and need to configure it to use our forward proxy (which requires authentication be set) so that the PHP scripts can connect to the internet correctly.

I see that PHP.INI in the 4 version had a pfpro.proxyaddress option but that is no longer available - so what has replaced it?

1 Answer 1


you can use curl for handling your http retrievals.

$ch = curl_init("http://whatever.com/something/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, "");
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt ($ch, CURLOPT_PROXYUSERPWD, "user:pass"); 

more info here

  • 1
    CURLOPT_PROXY with ip:port and a separate CURLOPT_PROXYPORT with the same port sounds unneccesary
    – Karsten
    May 25, 2009 at 9:45
  • @Karsten - yes. you're right.
    – pQd
    May 25, 2009 at 11:34
  • -1: That is code related - I am looking for a configuration related method as in v4 that can be set so all requests are proxied. May 25, 2009 at 14:34
  • @Robert MacLean - it seems what you ask for might be still not implemented - take a look at bugs.php.net/bug.php?id=29280 ; they also discuss kind-of-workaround with auto-append and changing settings of default context, but it's a hack
    – pQd
    May 25, 2009 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.