From: bug-php at misc dot lka dot org dot lu
Operating system: Linux
PHP version: 5.2.3
PHP Bug Type: HTTP related
Bug description: proxy_login / proxy_pass ignored
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 bug report at http://bugs.php.net/?id=41852&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41852&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41852&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41852&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41852&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41852&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41852&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41852&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41852&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41852&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41852&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41852&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41852&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41852&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41852&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41852&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41852&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41852&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41852&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41852&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41852&r=mysqlcfg