• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

php: command not found

C

cmer

Guest
Hello,

I just migeret my site on a server plesk 10.2.0 CentOS on the server there is a user who needs to perform tasks crontab php php -q /var/www/vhosts/blablabla.php but the stain crontab does not work and returns as an error

-: php: command not found

Is there a solution??
 
That command is broken if you give the user chrootsh for the shell; they either need full shell access to run cron jobs, or they need forbidden for that setting to take effect and let them run cron jobs.
 
I'm running Plesk 10.4.4 and when I tried the command as specified in the Administrator Guide:

/usr/local/psa/admin/bin/server_pref -u -crontab-secure-shell "/bin/sh"

I got the following output:

/usr/local/psa/admin/bin/server_pref: No such file or directory

I then tried this command:

/opt/psa/bin/server_pref -u -crontab-secure-shell "/bin/sh"

and got this output:

SUCCESS: Server preferences are successfully updated

Is this a safe fix?
 
Is this a safe fix?

Currently, that command will only work if the customer is set to have a forbidden shell (and unnecessary if you give them a full shell). If you give your customers chroot bash for their shell, they will not be able to run cron jobs no matter what you do.
 
Yep solution is in the documentation: http://download1.parallels.com/Plesk/PP10/10.2.0/Doc/en-US/pdf/plesk-10-administrator-guide.pdf
(Page 166 about crontab-secure-shell)

Hello Team,

I am also facing the same issue on my shared server.
-: php: command not found

I tried a lot to run cron script, but getting failure each time.

Manual says that, we have to run provided command to enable SSH. and then after the cron script can works.

So my question is that, where to execute command:
# /usr/local/psa/admin/bin/server_pref -u -crontab-secure-shell /bin/sh

Please help me to fix it ASAP.
 
Last edited:
Hello Team,

I am also facing the same issue on my shared server.


I tried a lot to run cron script, but getting failure each time.

Manual says that, we have to run provided command to enable SSH. and then after the cron script can works.

So my question is that, where to execute command:


Please help me to fix it ASAP.

The command that was given includes the full path; you'd run it as root while logged into the server via SSH.

Keep in mind that it has the limitations I pointed out previously; it is only going to be useful if your customers are set to have a shell of 'Forbidden' and is completely useless if they have a shell of /bin/bash. If you attempt to use it with the more secure option of "/bin/bash (chrooted)" then it will not work and your customers also won't be able to use SSH; i.e. the most secure setting to give your customers breaks their cron jobs.
 
Back
Top