• 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

Issue Schedule Task won't do anything

LBarraud

New Pleskian
Hello,

I'm trying to schedule a task on Plesk and here is the problem:

/usr/bin/php /var/www/vhosts/mydomain.com/httpdocs/app/console crontask --env=prod

Have i tried to run this in CLI ? -> yes! and it works

But when i'm scheduling a task and try to execute it, i've got this message:
Task "/usr/bin/php /var/www/vhosts/mydomain.com/httpdocs/app/console crontask --env=prod" completed with an error in 0 second.

nothing more, nothing less.

Has anyone any clue?
 
By default, for the scheduled tasks configured as chrooted shell which not allowed it to use standard utilities such as php and GET. To allow users to execute standard commands available at the server you can execute the following command:

# /usr/local/psa/bin/server_pref --update -crontab-secure-shell ""

At this point, scripts will successfully execute via the scheduler. If you would like to restore original state, you can run following command in the shell:

# /usr/local/psa/bin/server_pref --update -crontab-secure-shell /bin/bash
 
I did what you said, and i still have the same message..

Task "/usr/bin/php /var/www/vhosts/mydomain.com/httpdocs/app/console crontask --env=prod" completed with an error in 0 second.
 
/var/www/vhosts/mydomain.com/httpdocs/app/console
does not look like a .php script. Is it a .php script?

Instead of running a shell command ("Run a command"), would it be an option to choose "Run a PHP script" and to omit the /usr/bin/php and move the parameters intot the parameters field of that option?
 
Back
Top