PHP 4.0 Bug #8156 Updated: fopen() fails
| From: | jason@php.net | Date: | Fri, 08 Dec 2000 00:38:18 +0000 |
| Subject: | PHP 4.0 Bug #8156 Updated: fopen() fails | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40525@lists.php.net to get a copy of this message | ||
ID: 8156
Updated by: jason
Reported By: paul_tanner@alum.mit.edu
Status: Feedback
Bug Type: Filesystem function related
Assigned To:
Comments:
Can you include your configure line,
also can you print the output of $out after the fopen?
-Jason
Previous Comments:
---------------------------------------------------------------------------
[2000-12-07 09:24:38] paul_tanner@alum.mit.edu
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 stringn");
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?
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8156