View Full Version : fopen

SeeIT Solutions
11-22-2006, 12:05 PM
Does anyone know why an fopen command would need 777 permissions and not work with 775? How do I fix this?

11-22-2006, 12:34 PM
Either set the correct permissions on the file when you initially upload it to your server, or chmod (http://us2.php.net/manual/en/function.chmod.php)the file before you open it. I don;t know why you're having that problem with fopen -- permissions is usually a fwrite or fputs issue...

SeeIT Solutions
11-22-2006, 12:37 PM
I have to have every file and folder involved in the fopen set to 777. 775 just won't do it.


All of those need to be set to 777. index.php includes functions.php which fopens a file in uploads.

I've never had this problem before, and I'd really rather not have my files set at 777. The only difference I know of is that they are in directories protected by cpanel's directory protect function.

11-22-2006, 12:41 PM
That's strange, but if the files are in a .htaccess protected directory, I wouldn;t worry too much about it...no one's going to touch those files without the right username/password...

11-22-2006, 03:17 PM
775 will allow reading of files by 'other' but not writing. The options are to either chown (change the owner) chgrp (change group) or chmod the files so that the webserver user (www-data, www, 'nobody' etc.) has the appropriate role and permission