File permissions and Ownership in Php
Posted on 2014-01-03
Everytime I write a script which involves the creation of files and/or directories I have the same problems: in my Linux server (a shared host) first I must manually set permissions correctly because doing it from the script doesn't produce any result; then, if I need to delete those files, can't do it manually and I must use the script itself.
Today, I had a new problem, because the files created by the script have permissions set to 0000 and I can't delete them nor manually (via an ftp client, I mean) nor via script!
So, please, iluustrate the best practices to manage permissions in order to avoid these problems: I'll be grateful for ever. :)