Our PHP application is installed as 'root' on a Redhat5/CentOS system at: /var/www/html/beta/

After disabling SELINUX in order to allow these scripts to execute other programs on the system - What permissions are needed to run a system() command within a php script that writes to a folder?

I faced the error that the Apache error_log showed this:

 Cannot write log file 'ffmpeg2pass-0.log' for pass-1 encoding: Permission denied

The problem was that I had run ffmpeg as root at the same location, which created the 'ffmpeg2pass-0.log' log file.

I had changed permission on /var/www/html/beta to:

- drwxrwxr-x 19 apache apache 12288 Oct 25 08:20 beta

so that apache had appropriate permissions to write to the folder.

However, since I already had the log file at the same location (which had been created as 'root'), user 'apache' was unable to write/append to it! Hence the error message that I saw.

I simply deleted all instances of this file and that worked perfectly!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.