Re: PHP & GD open image file error
| From: | Anuradha Ratnaweera | Date: | Sat, 23 Dec 2000 04:26:30 +0000 |
| Subject: | Re: PHP & GD open image file error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31651@lists.php.net to get a copy of this message | ||
On Fri, 22 Dec 2000, Ken Whitmore wrote:
> I'm just starting out with GD in PHP and have a problem. I've created
> a file named drawimage.php with the contents listed at the end of this
> message. When I attempt to browse the page in MSIE, (haven't tried it
> on any other yet,) an error message appears in the browser window and
> a missing image icon shows below the message.
>
> The error message is as follows:
> Warning: imagegif: unable to open 'out.gif' for writing in
> /home/httpd/html/wow/pedigree/php/drawimage.php on line 8
>
> I've checked the server with phpinfo(); and it shows that GD is
> enabled and GIF support is also. The directory "dynamic_images" is set
> for drwxrw-rw- (to avoid somebody putting something executable in
> there and executing it). Assuming php is using "nobody" because it's
> being called by Apache, which is set for "nobody", what could be the
> problem here? (I'm assuming, because I haven't checked inside PHP for
> the user yet, but my Apache definitely uses "nobody".)
The x flag of a directory means whether you can "chdir" into it or not,
but nothing to do with the executables inside it. So you HAVE to make the
directory `chmod +x'.
As far as security reasons are concerned, people can't put things there
and execute, even if the "x" flags are set, unless you mark the directory
a script directory with "ScriptAlias". Also make sure that anyone can't
save files with `executable' extensions (say .php .php3 or even .cgi if
you have set extension based cgi) in that directory.
Anuradha