Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

[PHP3] fopen - strange things... From: Andre Anneck (anneck <email protected>)
Date: 07/27/98

Something strange is happening, i could track down the problem to
this part of a little scritp i wrote:
<SNIP>
  if(fopen($File,"r")) {
   $stream="";
   $layout="";
   for ( $rFile=fopen($File,"r"); !feof($rFile) ;
   $stream=fgets($rFile,1024)) {
    $layout.=$stream;
   }
  fclose($rFile);
  }
echo $layout;
</SNIP>

The problem:
This script opens a file that begins with http:// thus trying to
access a file for read via http.

On the server at my company:
Apache 1.3.0
PHP 3.0
SafeMode: 0

It works fine when the script try´s to open a file at
www.foo.de/path/path/foo.html

On my pivate domain:
Apache 1.3b5
PHP 3.0RC3
SafeMode: 0

It doesnt work at all. :-(

During the failure-tracking i noticed something else.
When i change the ending of the file, i get different results.
For example:
When the $file ending is .html
i get:
Warning: fopen("http://www.foo.de/foo.html","r") - Host is down in
When i change to file ending to .php3or .txt or .foo i get nothing
at all. It then seems like php is hanging. The site just keeps
loading forever. I even dont get a timeout... it just loads and loads
and.... :-(

I hope i provided enough information, if not pleas complain to
me... ;-)

I knwo that i could just contact my private domain host and tell hime
to upgrade to the latest version, but first i want to make sure the
problem is not somewhere in my script.

Take care,
André "the fool with a php-tool" Anneck

--------------------------------------
"Gravity can not be made responsible
 for people falling in love" - Albert Einstein.
--------------------------------------
web-master @ http://anneck.de
web-wizard @ http://www.tse-online.de
web-phone @ ICQ#: 1339921

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3