Forum archive
Newbie Linux Help
I need to create a shell script to run a php program so I can run it via a cron job. I am running the Joomla 2.5 Turnkey install, which works great BTW. Apparently I need to know where php is installed to add a line of code in the shell script before the location and php filename? I type php at the root command prompt and nothing happens, I also read that one can run the command 'which php' but that gives an error.
Here's what I have so far but it just doesn't work, I don't think php is installed here...
#!/bin/bash
/usr/bin/php /var/www/joomla/administrator/components/com_jdownloads/scan.php
I've spent all morning trying to figure this out, hopefully someone here can help.
TIA
To exexcute php from the commandline (and/or from a bash script/cron/etc) you need to have php5-cli installed. I don't recall if it is installed by default, but it's easy to install:
And OTTOMH that should be the correct path for php. To double check try this: