Page 1 of 1

Images created with imagejpeg (and similar) are always 600

Posted: Wed May 14, 2008 1:02 am
by neo_fox
Hi all,

I noticed that if I create an image using the function imagejpeg/imagepng the permissions of such file are always set to 600.
This is in most cases no problem if the Apache and PHP are running from the same user (Apache) but on several server (CGI ??) this files are no more readable.
All other files created or copied from PHP or Apache are always 644 (standard umask 22 I guess), so why the files created from php-gd having other permissions?
Is there any way to change it?

Kind regards and thanks in advance,
Neo

Re: Images created with imagejpeg (and similar) are always 600

Posted: Wed May 14, 2008 2:26 am
by onion2k
Use chmod() after you generate the image.

Re: Images created with imagejpeg (and similar) are always 600

Posted: Wed May 14, 2008 2:44 am
by neo_fox
Yes I know that this is the possible solution but I don't like use chmod.
It causing sometimes problems if the server has some security add ons, especially if it is not right configured.
I just wondering why 600 ?
The standard created files under Linux are always 666 and the standard umask is 0022 so the new created file should have 644 and not 600.
Or am I wrong?

Best regards,
Neo

Re: Images created with imagejpeg (and similar) are always 600

Posted: Wed May 14, 2008 4:03 am
by neo_fox
an other question: are the files created from php-gd always sets 600 or it is not normal?