Note that if you use oil, the files created will get the rights settings assigned to the current logged in user, which might conflict with your apache user. This might be the case here?
Yeah that appears to be the problem – but why was it working before 1.5? All of our 1.5 apps are having the same problem, it’s driving us nuts!
Here’s a couple of errors
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/Users/fuse/Sites/client/fuel/app/logs/2013/04/18.php" could not be opened: failed to open stream: Permission denied' in /Users/fuse/Sites/client/fuel/packages/log/src/Monolog/Handler/StreamHandler.php on line 71
If oil creates it, then Fuel can’t write. If Fuel writes to it, oil can’t edit it.
This probably has to do with umask() being removed from the code. PHP is switching to a threaded model, and umask() is not thread-safe, so it's best not to use it.
So the problem is that the chmod mask is applied, but taking the system's umask into account. This has been fixed in 1.6, where a separate chmod is executed after the file has been created to make sure it has the correct rights. For Fuel's internal code that is.
I've checked the code of the log package in 1.5.3, and it too does a separate chmod() on the created logfile, based on the permissions set for files in the file.php config file, or setting 0666 if that doesn't exist.
Without proper permissions set you'll never avoid this.
If you create a file in linux, it will always receive the current user as UID, and the users default group as GID. For a commandline user, the UID will be different then for your webserver.
So if multiple users need rw access to specific files, the only thing you can play with is the group, make it sticky on directories, make sure all relevant users are member of this group, and make sure the permissions (in the file.php config file) have at least rw for the group on files, and rwx for the group on directories.
The only way to avoid this is the hand out world rights, but I would suggest to avoid that at all cost.