>> > Set your cron job up as "lynx -dump
>> > http://www.myserver.com/myscript.php /dev/null"
>> > (or pipe it to a logfile if you fancy) - obviously,
>> > you'll need lynx installed for this to work :-)
>>
>> but this is only needed only if you compile php into apache or am i
>> wrong? if i have the cgi version installed, i can call the php script
>> directly from the shell. The only thing for me to do then, is to set
>>  #!/path.to/php in the first line of the script, right?
>
> Spot on. As a couple of others have pointed out, you can compile PHP to
> be a standalone interpreter and then write scripts for it - personally
> I always use it as a module, and I find using lynx works perfectly...
> if it ain't broken, don't fix it...

Please be very very careful with this advice. I use PHP to shell script
and can do some pretty dangerous stuff (eg: edit system configuration
files and HUP daemons). If this script was exectuted via the web there
could be 3 major issues:

1. Apache would have be live and working in order for the script to run.
Not good if starting apache is what your intending!2. Security - its web accessable! 
You are going to have to bolt down your
apache like a rat's ass to make sure no1 gets in to malioulsy execute your
code. Even then theres no gaurentee that there will be no apache exploit
to get around it.3. You might want the script performed as a certain user. With the 
cron
and a binary your executing it as the cron owner... which is essential for
editing files and HUPing processes that dont belong to the web process.

If your execing PHP scripts from cron I highly recommend using the binary,
if only for standalone purposes. It all depends what your after doing...
experimentation is the key, and imho you should stick to the binary for
shell stuff and the module for web stuff.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to