ID:               41852
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bug-php at misc dot lka dot org dot lu
-Status:           Open
+Status:           Bogus
 Bug Type:         Streams related
 Operating System: Linux
 PHP Version:      5.2.3
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The proxy authentication is generally done by sending the 
Proxy-Authorization header which you can add using the generic headers

streams context option. Alternatively if authentication is done via
HTTP 
Auth, you can do [EMAIL PROTECTED] in the URL.


Previous Comments:
------------------------------------------------------------------------

[2007-06-29 09:17:36] bug-php at misc dot lka dot org dot lu

Description:
------------
When fopen'ing a web page, and using a proxy in the stream context,
there is no way to specify proxy username and password

N.B. non-authenticating proxies work just fine.

Reproduce code:
---------------
<?php
$opts = array('http' =>
    array(
          'proxy' => 'tcp://localhost:2001/',
          'request_fulluri' => True,
          'proxy_login' => 'fest1',
          'proxy_password' => 'xxx'
    )
);
$context  = stream_context_create($opts);
$fp=fopen("http://www.lgl.lu/";, "r", false, $context)
  or die("Cannot load\n");
print "fp=$fp";
while(!feof($fp)) {
  $in=fgets($fp,1024);
  print $in;
 }
?>


Expected result:
----------------
It should display the page from www.lgl.lu

Actual result:
--------------
It logs an error:
[Fri Jun 29 11:06:21 2007] [error] [client ::1] PHP Warning: 
fopen(http://www.lgl.lu/) [<a href='function.fopen'>function.fopen</a>]:
failed to open stream: HTTP request failed! HTTP/1.0 407 Proxy
Authentication Required\r\n in
/home/aknaff/public_html/php-test/download.php on line 14

and this even though login and password are correct.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41852&edit=1

Reply via email to