#39594 [NEW]: fsockopen

From: Date: Wed, 22 Nov 2006 19:00:40 +0000
Subject: #39594 [NEW]: fsockopen
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105324@lists.php.net to get a copy of this message
From: realtime158 at hotmail dot com Operating system: Linux 2.6.9-42.0.3 PHP version: 4.4.4 PHP Bug Type: *General Issues Bug description: fsockopen Description: ------------ fsockopen will not work to any local page located within that domain. And will not render the page. If i copy the url into the browser it works no problems. Also it will work on any other domain other then ours. The admin from the hosting company that we purchased a box off told us this. Since your server is behind a firewall, you will not be able to include files from other sites on your server by using the domain name. The domain names all resolve to the external IP address, but that IP address cannot be accessed from behind your firewall. Reproduce code: --------------- <?php $fp = fsockopen ("http://www.fetchads.com/login/index.php", 80, $errno, $errstr, 30); if(!$fp) { echo $errstr; } else { fwrite($fp, "GET / HTTP/1.1\r\nHost: www.fetchads.com\r\nConnection: Keep-Alive\r\n\r\n"); $data = ''; while(!feof($fp)) { $data .= fread($fp, 4096); $content .= $data; if(substr($data, -9)=="\r\n\r\n0\r\n\r\n") { exit; } } } $content = preg_replace('/^(.+?)(\r\n|\n|\015\012){2}/s','',$content); echo $content; ?> Expected result: ---------------- I would like the php code to produce the same screen or close to it as if I were to type it in the browser like this http://www.fetchads.com/login/index.php Also i am open to any alternatives except installing php5. Or any new snapshots -- Edit bug report at http://bugs.php.net/?id=39594&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39594&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39594&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39594&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39594&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39594&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39594&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39594&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39594&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39594&r=support Expected behavior: http://bugs.php.net/fix.php?id=39594&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39594&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39594&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39594&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39594&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39594&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39594&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39594&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39594&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39594&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39594&r=mysqlcfg

« previous php.bugs (#105324) next »