Plesk

Running a Cron job via Scheduled Tasks in Plesk fails: Permission denied

Symptoms

Cause

Lack of permissions on the script file or missing command in the chroot environment.

Resolution

  1. Log in to Plesk.

  2. Change the shell for the subscription to /bin/bash in Subscriptions > example.com > Web Hosting Settings > Access to the server over SSH.

    Note: The next step is not necessary in case the executable file cannot be accessed via Plesk File manager.

  3. Correct permissions or task type.

    • For shell scripts:

      Find the affected file in Domains > example.com > File Manager and add executable permissions:

    • For the .php scripts:

      Recreate the task as Run a PHP script one in Domains > example.com > Scheduled Tasks > Add Task: