Cron job gives permission error on execution

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/ Permission denied in /var/www/ on line 0” while reading response header from upstream, client:, server:, request: “GET /cron-wurfl.php HTTP/1.1”, upstream: “fastcgi://”, host: “

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.


Hi Thanks for reply, the cache folder is set to 777 and I think the ionCube loader issue is solved but i still have the the error. Could it be an ownership issue?

There seems to be two pieces that I can gather from your query!

1.) Permissions error while ruinning CRON: It seens that cache folder in your installation is not set with 777 permissions. Generally in popular CMS distributions, this is how it works!

2.) Issues with ionCube Loaders: There is a easy to implement ionCube article. Once done, you should run this file. It will give you another INI file and also tell you where to place it (depending on your installation of PHP FCGI).

Just an observation, it may so happen that once you resolve your ionCube Loader issue, your first piece may get resolved automatically!

Let’s see how it goes!

Submit an 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.

BINGO problem solved! Thanks for the answers, much appreciated

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/