[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] PHP scripts via CRON



At 10:06 AM +0000 3/29/00, David Dotson wrote:
>Has anybody successfully setup a PHP script to run as a CRON process on a
>RaQ?
>

I wrote this up for a different list last week. It may be helpful here.

----------------------------------------------------

I did this on a couple of different Cobalt boxes which I have comlete
control over (Cobalt RaQ2 and Qube2).

First I compiled PHP. It doesn't hurt to run two different compilations of
PHP on the same machine. You can even run two different versions. My boxes
are running mod_php3, so I needed to compile php as a "cgi" to use
command-line scripting such as PhorumMail. Anyway, I happened to have the
PHP 3.0.14 source sitting around, so I simply:

./configure --with-mysq --enable-track-vars
make
make install

This moved php to /usr/local/bin

To test and make sure php was working use our little test.script friend:

#!/usr/local/bin/php -q
<?php

    print( "Hello, world!\n");

?>

Make sure it is executable (chmod +x test.script) and /usr/local/bin is in
your $PATH.

./test.script should return -> Hello, world

You will also need to determine if your system is using smrsh (RaQ2). I
believe, on most red hat installs, it would be /etc/smrsh. On my boxes
(RaQ2), it's /usr/adm/sm.bin/. If it is using smrsh, you'll need to
symbolically link php in that directory for sendmail to have access to php.