On Wed, 2004-04-21 at 17:20, QuickBrownFox wrote:
> You'll also have to make sure that either the script starts with a #! 
> reference to the php interpreter (usually #!/usr/bin/php), or that the 
> cron job invokes the interpreter using  something like /usr/bin/php 
> /path/to/script.php.  If you choose the first (I think it's a bit 
> easier), make sure the file permissions allow it to be executed.

Also, to suppress any http headers that get echoed out, add "-q" to the
php invocation.

ex:

#!/usr/bin/php -q
<?
echo "Hi\n";
?>


Michael


> 
> Lloyd Brown
> 
> Frank Sorenson wrote:
> 
> >On Wed, 21 Apr 2004, Mark Gardner said:
> >  
> >
> >>I'm Running SUSE LINUX 9.0 Professional
> >>
> >>How do I get a PHP script "script.php" to run as a cron job?  I want it
> >>to run daily @ 3:00 AM 
> >>
> >>Mark Gardner
> >>    
> >>
> >
> >Add to /etc/crontab:
> >
> >00 3 * * * root /path/to/script.php >/dev/null 2>&1
> >
> >Frank
> >---------------------------------------------------------------------------
> >Frank Sorenson - KD7TZK
> >Systems Manager, Computer Science Department
> >Brigham Young University
> >[EMAIL PROTECTED]
> >
> >____________________
> >BYU Unix Users Group 
> >http://uug.byu.edu/
> >___________________________________________________________________
> >List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
> >
> >  
> >
> 
> 
> 
> ____________________
> BYU Unix Users Group 
> http://uug.byu.edu/
> ___________________________________________________________________
> List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
-- 
Michael Torrie <[EMAIL PROTECTED]>

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to