Note that there are some explanatory texts on larger screens.

plurals
  1. POfile_get_contents behind a isa proxy under apache
    primarykey
    data
    text
    <p>I am developing a script which deal with accessing remote site data. For this purpose i am using <code>file_get_contents()</code> function. it was working fine in home but no connectivity in office. then after googling i found using proxy header with <code>file_get_contents()</code></p> <p>my script is as follow which i got from stackoverflow's thread <a href="https://stackoverflow.com/questions/1336262/file-get-contents-behind-a-proxy">file_get_contents()</a></p> <pre><code>$auth = base64_encode('mywindowlogin:password'); $opts = array('http' =&gt; array('proxy' =&gt; 'tcp://172.20.10.130:8080', 'request_fulluri' =&gt; true,'header' =&gt; "Proxy-Authorization: Basic $auth",)); $context = stream_context_create($opts); $data = file_get_contents('http://www.lesco.gov.pk/', false, $context); echo $data; </code></pre> <p>this OUTPUT with an ERROR </p> <pre><code>[function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web P in D:\php\docs\url.php on line 7 </code></pre> <p><strong>Real question</strong> Comes here that in office they are using ISA Proxy server and i am using PHP on apache </p> <ol> <li>do i need to use Window login as userid or something esle? </li> <li>i am doing something wrong while passing userid and password for proxy authorization? OR</li> <li>What i am doing is not the right way of doing it?</li> </ol> <p>please suggest me how or what to do make <code>file_get_contents</code> working through proxy server. thanks in advance </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload