Permission Issue when running a PHP file through Cron
Posted on 2013-06-13
I've had a few questions answered around the topic of call a PHP File through Cron, and seem to hit a problem every step of the way!
The latest problem.....
So, i'm using Cron to call a PHP file, which is working fine and the script is being called. The script is designed to delete some files from the root of my site.
When I run this outside of Cron, it works fine (run as in, upload the PHP and navigate to it), and the appropriate files are being deleted.
However, when the script is called through Cron, I get a permissions error.
PHP Warning: unlink(): Unable to access ../Uploaded_Files/MS_Keys.xlsx in /var/www/vhosts/"Domain"/httpdocs/Code/clean_up.php on line 16 102
Where MS_Keys.xlsx is the file that needs to be deleted.
I'm using Plesk 11 through my webhosts to configure the site, although I do not have access to the shell to run any scripts directly on it.
Now this seems like a permissions issue. Does anyone know where I change the permissions on the folder 'Uploaded_Files', and what I need to change it to so that my script can delete any files contained within it?
Many humble thanks in advance,