Report this

What is the reason for this report?

Cron job gives permission error on execution

Posted on August 1, 2015

I am running a tracker (CPVLab) hosted on a Lemp Stack The site works fine but there is a problem with a cron job. When the cron job executes I get an error:

2015/08/01 07:00:04 [error] 1303#0: *605 FastCGI sent in stderr: “PHP message: PHP Warning: unlink(/var/www/mysite.com/htdocs/WURFLres//storage/cache/1/3/dfe45504453a9fc3d1ff7a090cd225): Permission denied in /var/www/mysite.com/htdocs/WURFL/Storage/File.php on line 0” while reading response header from upstream, client: 46.101.44.xxx, server: mysite.com, request: “GET /cron-wurfl.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “mysite.com

I set up the cron job using crontab -e as root, no other errors present but I did have issues with ionCube leaders to start with. Can anyone help please. Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Are you using wget to request the file on crontab?

If so it doesn’t matter if cron is setup as root or any other user as it is Nginx and PHP-FPM executing the file as the web user.

Try changing the ownership of the whole directory:

chown -R www-data:www-data /var/www/mysite.com/htdocs

BINGO problem solved! Thanks for the answers, much appreciated

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.