QWeb Ric
Basic Pleskian
This seems to be an issue that's well documented, but I've crawled through existing threads for hours and can't seem to find a solution that works for me.
In a nutshell, I have a fresh Plesk 17.8.11 running on a fresh CentOS 7.4.1708, and I can't seem to get scheduled PHP scripts to run.
There's only one subscription at the moment. It's set up with "Access to the server over SSH" set to "/bin/bash (chrooted)".
Tools & Settings -> Scheduled Tasks -> Settings is currently set to have the Crontab shell as /bin/bash . Have tried /bin/sh which my other CentOS 6.9 servers use. I can't remember what the default was now... possibly /bin/bash (chrooted).
Finally, I have the scheduled task set up, like this:
cd /var/www/vhosts/mydomain.co.uk/httpdocs/scripts; php -f myscript.php
But either leaving the task to run on schedule via cron, or using the "run now" buttons, I'm getting the following errors:
-: line 0: cd: /var/www/vhosts/mydomain.co.uk/httpdocs/scripts: No such file or directory
-: php: command not found
I realise Plesk gives the "Run PHP script" option instead of setting up as a command, but the script itself relies on being run as a command (it uses things like the getcwd() function) and being able to load in modules that are shared by the website. Basically, I need to do it the "Run as command" way.
I run other servers with the same Plesk version and have no issues on those. This is the only server that's CentOS 7 though, and it's been years since I configured the others so perhaps I've forgotten something important.
Any thoughts please?
In a nutshell, I have a fresh Plesk 17.8.11 running on a fresh CentOS 7.4.1708, and I can't seem to get scheduled PHP scripts to run.
There's only one subscription at the moment. It's set up with "Access to the server over SSH" set to "/bin/bash (chrooted)".
Tools & Settings -> Scheduled Tasks -> Settings is currently set to have the Crontab shell as /bin/bash . Have tried /bin/sh which my other CentOS 6.9 servers use. I can't remember what the default was now... possibly /bin/bash (chrooted).
Finally, I have the scheduled task set up, like this:
cd /var/www/vhosts/mydomain.co.uk/httpdocs/scripts; php -f myscript.php
But either leaving the task to run on schedule via cron, or using the "run now" buttons, I'm getting the following errors:
-: line 0: cd: /var/www/vhosts/mydomain.co.uk/httpdocs/scripts: No such file or directory
-: php: command not found
I realise Plesk gives the "Run PHP script" option instead of setting up as a command, but the script itself relies on being run as a command (it uses things like the getcwd() function) and being able to load in modules that are shared by the website. Basically, I need to do it the "Run as command" way.
I run other servers with the same Plesk version and have no issues on those. This is the only server that's CentOS 7 though, and it's been years since I configured the others so perhaps I've forgotten something important.
Any thoughts please?