php shell script questions

Hal Burgiss hal at burgiss.net
Tue Jul 14 12:28:59 UTC 2009


On Tue, Jul 14, 2009 at 7:15 AM, bill<william at techservsys.com> wrote:
> I need to run a php script from cron.
> I will be developing it from the console using the cli.
>
> for debugging use, do echo statements echo to the console or do I need to
> explicitly open the console for output ?

'echo' echoes to STDOUT. You don't need to do anything special.

> when I finish the testing and want to start it from cron, would I use
>  php {scripname.php}  as the cron command, or is there a shebang that I can
> put at the head of the script and then just cron the scriptname ?

Either way works. !#/usr/bin/php (for Ubuntu location. In the latter
case, the script of course has to be set executable. The former not.

Its easy enough to do a simple test, no?

-- 
Hal




More information about the ubuntu-users mailing list