Kalaiyarasan
Kalaiyarasan

Reputation: 13414

Crontab is not working in plesk after changing the path too

Hi i have tried to run the php file in the plesk by using cronjob by the following commands.But everything is showing the errors. Not executing the php script.

i.e.,

php -q /path to the file

shows php command not found.so i have tried to find the path for php by using

which php

it displays the path /usr/bin/php. after that i have tried with

/usr/bin/php -q /path to the file

it shows /usr/bin/php no such file or directory

The same way i tried for

/usr/bin/env /usr/bin/php -q /path to the file

/usr/bin/curl /url of the file

/usr/bin/wget /url of the file

every thing is showing the error and not executing the script. what is wrong with this. Can any one suggest me. thanks in advance

Upvotes: 0

Views: 4726

Answers (1)

Ivan Argulo
Ivan Argulo

Reputation: 46

I'll tell you what worked for us. First of all, we checked that cURL is installed. It wasn't so we installed it. Then we followed the following steps:

http://shaun.net/2011/09/solving-plesk-10-3-1-cron-issues/

To fix the problem and restore behaviour to how it worked in previous versions of Plesk, all you need to do is run the following command: /usr/local/psa/bin/server_pref -u -crontab-secure-shell "/bin/sh"

But you have to find the correct route of your file "server_pref". Following these steps, we are able to use the cron with curl -q http://youradress.com/cron.php

Hope it helps, best regards

Upvotes: 3

Related Questions