1

As a customer in Plesk, I am attempting to run:

php -q /httpdocs/_external/export/test.php

From this tutorial: http://daipratt.co.uk/crontab-plesk-php/

I'm receiving the error

"php: command not found"

Is there something I need to enable from the main user or a different command I would need to use to run the script?

(also tried /bin/php with no luck, there is no php file in that dir)

"which php" -/usr/bin/php (when I use this dir I also get "no such file or dir" I guess since when I use / it's pulling from the customers root not the server root)

kilrizzy
  • 2,895
  • 6
  • 40
  • 63
  • If you have `ssh`access do a `which php` to see where the binary is (usually `/usr/bin/php` – konsolenfreddy Dec 19 '11 at 15:50
  • 1
    What does this give you: `find / | grep php`. It could also be `php5`. – ldiqual Dec 19 '11 at 15:51
  • Added "which php" path in description. Is there a way to get it if I can't access the root dir? Or a way to give this customer permissions from the root admin – kilrizzy Dec 19 '11 at 16:00
  • @ldiqual - It listed a million files (/usr/local/psa/...), it is php 5.3...oh I gotcha the command, still no luck "php5: command not found" – kilrizzy Dec 19 '11 at 16:02
  • php is installed, right? – Manos Dilaverakis Dec 19 '11 at 16:09
  • Yup, the script itself works great running directly. My bin folder for that user though would be /bin/, but there is no php file inside (there is however bash,grep,mkdir...) – kilrizzy Dec 19 '11 at 16:15

1 Answers1

1

This answer will help you. My understanding is that Cron runs everything relative to itself, so you should always use absolute paths when running something from Cron.

Good luck, and happy holidays!

Community
  • 1
  • 1
Tim
  • 749
  • 4
  • 14