bradgrafelman has been a huge help in getting me this far, but I've still got a missing link between creating a script that runs correctly in the ksh shell and using that script in a cron job.
This works perfectly in the shell:
$ php -c /usr/local/opt/coolstack/php5/lib -f __laagjob.php
...this php script runs without a hitch and does what I need it to do (run some mysql actions like replacing a table).
I also now know how to create a crontag, and it appears to run at the correct time. ie:
* ./shebang.php (this runs every minute while I'm testing this)
THE PROBLEM IS THIS: The job runs, but it does not find php and so the cron job sends me a message that the script ran but did not do what it's supposed to do...even with a simple HELLO WORLD action.
Here is the "shebang.php" script. Note that the shebang line contains the same path that DOES work in the shell commad that I said works perfectly.
#!/usr/local/opt/coolstack/php5/lib
<?php
echo "HELLO WORLD\n";
?>
The message that I get back from the server is:
Your "cron" job on www.blah.blah
./shebang.php
produced the following output:
sh: ./shebang.php: not found
I have found that in the shell, the following DOES appear to work:
$ php ./shebang.php
HELLO WORLD
However, if I try to add the php into the crontab line, the message still comes back like this:
Your "cron" job on www.blah.blah
php ./shebang.php
produced the following output:
sh: php: not found
I feel like I'm really close here. I guess it must have something to do with the syntax of the shebang line (#!/usr/local/opt/coolstack/php5/lib) in the php script.