I have a server for which I have created a cron job "sendalerts" to users. Mind you this "sendalerts.php" should be runnable from two methods (via browser and also via a cron job)
So cron's job is to execute a php file which then sends the alerts out, something like this:
01 01 * * * /usr/bin/php -f /var/www/vhosts/xxxxx.com/xxx/sendalerts.php
But it keeps failing with the log message:
Could not open input file: /var/www/vhosts/xxxxx.com/xxx/sendalerts.php
So I checked the file group and owner of "sendalerts.php" and realized it was "anothergroup" (since it was created through Plesk filemanager) for which "root" is not a member. I then deleted and recreated "sendalerts.php" from SSH with root. But this would not grant me access to running the same file in browser as I would sometimes want to (manually send the alerts).
Yet I get the same log error when cron tries to execute (
Could not open input file: /var/www/vhosts/xxxxx.com/xxx/sendalerts.php)
Currently my possible solution would be to recreate the same file using Plesk filemanager and then add "root" user to the "anothergroup" group .
But for this my question is: would that be a safe and secure thing to do? Considering now the group "anothergroup" may have "root" user permissions (if I'm not wrong in my understanding).