Setting permission for CRON tasks file


I am getting error as “permission denied” while running cron task.

Do you set permission by

  1. right clicking PHP file in FTP Software
  2. through cron command
  3. through PHP code in PHP file which is to be run as cron task

How do you set permission ??


Hi, answer 1) seems to be the way forward. In your FTP client make sure file you are trying to run is Executable (+x bit set) and can be read/executed by the user which your cron daemon use. Also on some system (Debian) file needs to belong to the same user as cron process. So for example if your cron daemon runs as www-data user, your file needs to be: a) executable; b) belong to www-data user. Hope this helps.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.