Different file owner for files created via cron vs apache

vimaxmaxvv

New Member
I have a web application which has a shared config.php file. In this file, I include a function which gathers error messages (using \[code\]set_error_handler\[/code\]) and then, at the end of the script execution, saves the errors to a centralised log file (using \[code\]register_shutdown_function\[/code\]).Log files are created daily, in the format \[code\]Y-m-d.log\[/code\]. Cron scripts run every 5 minutes as part of the application, so are usually the cause of the first errors each day and so the error file is created under the cron user, which is the account superuser.When our staff come in to work and use the application, the script runs under the apache user (99). The error logger can't write to the error file, as it is owned by superuser.One possible solution is to have the cron script \[code\]chown\[/code\] the log file to 99, so that it can be accessed by the apache user. Is uid 99 an accepted convention for apache hosting, or will I be causing future portability issues if I hard-code 99 in?Are there any other ways (without resorting to \[code\]exec\[/code\]/\[code\]sudo\[/code\]) to make my log accessible?Update: I don't have shell access to the server.Thanks, Adam
 
Back
Top