A2 Hosting Forums

Full Version: PHP file permissions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've migrated a PHP app from Windows to Linux here that includes user image galleries. It was programmed using umask() for handling file permissions during directory and upload actions, which didn't seem to be working. The need is to normally have the directories and files with 0755, but switch to 0777 for the writes and deletes (although I'm not sure what was happening  on Windows, nor do I want to know...)

I'm guessing that umask is inherited from Linux via Apache(?), and chmod() didn't run as a fix for me. So I am using ftp_chmod() to handle the switch to 0777 and then back to 0755, and that works and seems like a safe way to handle it.

Any advice or clarifications appreciated.
Reference URL's