Hi,
I have a web application which has a shared config.php file. In this file, I include a function which gathers error messages (using set_error_handler
) and then, at the end of the script execution, saves the errors to a centralised log file (using register_shutdown_function
).
Log files are created daily, in the format Y-m-d.log
. 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 chown
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 exec
/sudo
) to make my log accessible?
Update: I don't have shell access to the server.
Thanks, Adam