• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Scheduling php script problem

D

damargon

Guest
I am trying to execute a php script from "Scheduled Tasks". I have created the cron task in root and apache user by this way in the command field:

/var/www/vhosts/mydomain/httpdocs/script.php

but I am getting this error:

***************************************
/bin/sh: line 1: /var/www/vhosts/mydomain/httpdocs/script.php: Permission denied
***************************************

I have changed the script's chmod to rwx r-x r-- but I'm getting the same error.

Anyone can help me please?

Thanks!!
 
Well, I have resolved the problem.

I have forgotten to especified in the command field which is gonna be the interpreter: php.

This is the line:
php var/www/vhosts/mydomain/httpdocs/script.php

Now it works fine, thanks!
 
Back
Top