#23520 [Opn->Fbk]: PEAR Remote calls do not use Proxy Setting
| From: | arnaud@php.net | Date: | Mon, 26 May 2003 13:51:36 +0000 |
| Subject: | #23520 [Opn->Fbk]: PEAR Remote calls do not use Proxy Setting | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16708@lists.php.net to get a copy of this message | ||
ID: 23520
Updated by: arnaud@php.net
Reported By: aashley at optimiser dot com
-Status: Open
+Status: Feedback
Bug Type: PEAR related
Operating System: Gentoo Linux (2.4.20)
PHP Version: 4.3.1
Assigned To: pajoye
New Comment:
Is it still buggy ?
Previous Comments:
------------------------------------------------------------------------
[2003-05-11 20:48:23] aashley at optimiser dot com
hrmmm no way to attach files to this thing, oh well be warned this is a
long post.
I knocked up the following script to test 4 cases of accessing servers
using fsockopen from my development server.
1. Access the server script running on
2. Access a site which the firewall will allow direct access to
(another development box)
3. Access an external site that the firewall with disallow direct
access to (www.php.net)
4. Access the same external site this time through the proxy server.
Script
===================================================
<?php
echo "Connecting to local machine...\n";
$fp = fsockopen ("dt-pc0144.perth.optimiser.com.au", 80, $errno,
$errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET /test.html HTTP/1.0\r\nHost:
dt-pc0144.perth.optimiser.com.au\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
echo "\n=======================\n"
."\n"
."Connecting to box which firewall allows direct connect...\n";
$fp = fsockopen ("tuna.optimiser.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET /test.html HTTP/1.0\r\nHost:
tuna.optimiser.com\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
echo "\n=======================\n"
."\n"
."Connecting to box which firewall disallows direct connect...\n";
$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
echo "\n=======================\n"
."\n"
."Connecting to box which firewall disallows direct connect through
proxy...\n";
$fp = fsockopen ("proxy.perth.optimiser.com.au", 3128, $errno, $errstr,
30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET http://www.php.net/ HTTP/1.0\r\nHost:
proxy.perth.optimiser.com.au\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>
===================================
End Script
Script Output
===================================
Connecting to local machine...
HTTP/1.1 200 OK^M
Date: Mon, 12 May 2003 01:41:31 GMT^M
Server: Apache/1.3.27 (Unix) (Gentoo/Linux) PHP/4.3.2-RC3-dev
mod_gzip/1.3.19.1a^M
Last-Modified: Mon, 12 May 2003 01:33:30 GMT^M
ETag: "340086-b-3ebef9ea"^M
Accept-Ranges: bytes^M
Content-Length: 11^M
Connection: close^M
Content-Type: text/html^M
^M
It Worked!
=======================
Connecting to box which firewall allows direct connect...
HTTP/1.1 200 OK^M
Date: Mon, 12 May 2003 01:41:31 GMT^M
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12
OpenSSL/0.9.6b DAV/1.0.2 PHP/4.3.0 mod_perl/1.26^M
Last-Modified: Mon, 12 May 2003 01:35:08 GMT^M
ETag: "719d0-b-3ebefa4c"^M
Accept-Ranges: bytes^M
Content-Length: 11^M
Connection: close^M
Content-Type: text/html^M
^M
It Worked!
=======================
Connecting to box which firewall disallows direct connect...
Warning: fsockopen(): php_hostconnect: connect failed in
/home/aashley/web/fopen.php on line 32
Warning: fsockopen(): unable to connect to www.php.net:80 in
/home/aashley/web/fopen.php on line 32
Connection timed out (110)<br>
=======================
Connecting to box which firewall disallows direct connect through
proxy...
HTTP/1.0 200 OK^M
Date: Mon, 12 May 2003 01:30:47 GMT^M
Content-Type: text/html;charset=ISO-8859-1^M
Server: Apache/1.3.26 (Unix) PHP/4.3.2-RC3-dev^M
X-Powered-By: PHP/4.3.2-RC3-dev^M
Last-Modified: Mon, 12 May 2003 01:08:10 GMT^M
Content-Language: en^M
X-Cache: HIT from rs1.php.net^M
Via: 1.0 netcache (NetCache NetApp/5.3.1R2D4)^M
X-Cache: HIT from proxy.perth.optimiser.com.au^M
Proxy-Connection: close^M
^M
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PHP: Hypertext Preprocessor</title>
<snip a whole lot of website>
</body>
</html>
<!-- 0.021165013313293 -->
=====================
End Output
------------------------------------------------------------------------
[2003-05-10 15:59:24] nicos@php.net
I can't reproduce it too.
Can you try to use fsockopen() with something else please to see if you
have any problem with it?
------------------------------------------------------------------------
[2003-05-07 03:50:01] aashley at optimiser dot com
hrmmm strange I set verbose to 3 but it hasnt made any change to the
output, is the logging sent to a file?
dt-pc0144 root # pear config-set verbose 3
dt-pc0144 root # pear list-all
PEAR_Remote::call: fsockopen(`pear.php.net', 80) failed
------------------------------------------------------------------------
[2003-05-07 03:16:28] arnaud@php.net
Btw, could you do a
pear config-set verbose 3
pear list-all
it should provide useful debugging info.
------------------------------------------------------------------------
[2003-05-07 03:00:59] aashley at optimiser dot com
Ive just installed PHP Version 4.3.2-RC3-dev
(php4-STABLE-200305070530.tar.bz2 from snaps.php.net). It has upgraded
the PEAR objects to 1.1.
I'm still getting the same failure.
dt-pc0144 root # pear list-all
PEAR_Remote::call: fsockopen(`pear.php.net', 80) failed
The pearcmd.php that is being executed has the following cvs version
string:
// $Id: pearcmd.php,v 1.1.2.1 2003/04/11 23:48:39 ssb Exp $
<offtopic>
yup, perth, western australia, best city in the country :)
</offtopic>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23520
--
Edit this bug report at http://bugs.php.net/?id=23520&edit=1