RE: [PHP] tmpfile() errors?
| From: | James E. Hicks III | Date: | Wed, 22 May 2002 20:30:28 +0000 |
| Subject: | RE: [PHP] tmpfile() errors? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98819@lists.php.net to get a copy of this message | ||
I'd check the owner of the directory you are trying to write to. It needs to be
owned by the same user as the httpd process runs as.
James
-----Original Message-----
From: Jas [mailto:jlgerfen@hotmail.com]
Sent: Wednesday, May 22, 2002 4:18 PM
To: php-general@lists.php.net
Subject: [PHP] tmpfile() errors?
Here are the errors I am recieving:
Warning: fopen("Resource id #4","wb") - Permission denied in
/path/to/asciiartist.php on line 295
Warning: Supplied argument is not a valid File-Handle resource in
/path/to/asciiartist.php on line 296
Warning: Supplied argument is not a valid File-Handle resource in
/path/to/asciiartist.php on line 297
Warning: getimagesize: Unable to open 'Resource id #4' for reading. in
/path/to/asciiartist.php on line 303
ASCIIArtist(): Cannot determine image type of shared/image02.jpg.
I have checked the file permissions for the files and directory in question
and they are all set to read & write, so I know this is not the problem.
Here is the function that I am trying to get to work.
function ASCIIArtist($image)
{
if ($input = @fopen($image, "rb")) {
$image_data = fread ($input, 2048576);
fclose($input);
$tmp_image = tmpfile();
$output = fopen($tmp_image, "wb");
fwrite($output, $image_data);
fclose($output);
} else {
exit("Cannot access ".$image." for reading. (Does not exist or
has wrong permissions)");
}
This code is from http://www.sebastian-r.de/. And
everything works fine
until it hits this function. Could I get some enlightenment on why it cannot
create a temp file named $tmp_image? (ecspecially when the permissions for
the file are correct?) Thanks in advance,
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php