PHP 4.0 Bug #8156: fopen() fails

From: Date: Thu, 07 Dec 2000 14:24:38 +0000
Subject: PHP 4.0 Bug #8156: fopen() fails
Groups: php.dev 
Request: Send a blank email to php-dev+get-40371@lists.php.net to get a copy of this message
From: paul_tanner@alum.mit.edu Operating system: RedHat Linux 6.2 PHP version: 4.0.3pl1 PHP Bug Type: Filesystem function related Bug description: fopen() fails You may be able to shed some light on this PHP problem. Have not used the facility to write files before so apologies if this is a simple config issue. Anything that tries to write to a file fails. I checked that the target directory is writable by the Apache user (nobody). This is set to 777. Here's a test prog: <html><body> <h2>file write test</h2> <? $out=fopen("/home/handyman/DB/tmp.tmp","w") || die ("Can't open file for write"); fputs($out,"test string\n"); fclose($out); ?> </body></html> Here's the result. file write test Warning: Supplied argument is not a valid File-Handle resource in /home/handyman/public_html/traveller/test.php on line 7 Warning: Supplied argument is not a valid File-Handle resource in /home/handyman/public_html/traveller/test.php on line 8 Note: It did not fail the fopen() it did, however, fail the write and the close. It creates a file of zero length. The file handle did not get created properly. But why? -- Edit Bug report at: http://bugs.php.net/?id=8156&edit=1

« previous php.dev (#40371) next »