Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

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, "http://10.14.10.1:3128");
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt ($ch, CURLOPT_PROXYUSERPWD, "user:pass");

more info here

share|improve this answer
1  
CURLOPT_PROXY with ip:port and a separate CURLOPT_PROXYPORT with the same port sounds unneccesary –  Karsten May 25 '09 at 9:45
    
@Karsten - yes. you're right. –  pQd May 25 '09 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. –  Robert MacLean May 25 '09 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 '09 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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