Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
It's because you must first create a context where you explicitly tell PHP that the stream related functions (which file_get_contents is) that they must use a proxy.
Or you should configure your proxy to be transparent, but this is another story.
Look at this comment: http://ch.php.net/file_get_contents#58758
You have a bit of PHP code that explains how to setup such context.
PHP Code:
<?php // Define a context for HTTP. $aContext = array( 'http' => array( 'proxy' => 'tcp://127.0.0.1:8080', 'request_fulluri' => True, ), ); $cxContext = stream_context_create($aContext);
// Now all file stream functions can use this context. $sFile = file_get_contents("http://www.php.net", False, $cxContext); echo $sFile; ?>
__________________
Only a biker knows why a dog sticks his head out the window.
Last edited by tripy; 02-10-2009 at 03:19 AM..
|