Click to See Complete Forum and Search --> : automation of PHP script under Linux


yannLH
08-11-2003, 10:25 AM
Hi,
I would like to execute a PHP script every day automatically in order for my information on my website to keep being accurate.
I have a linux and so I thought I could do it with cron. I also found that there exists CLI, a php module that executes PHP in command line. But the problem comes from the fact that CLI only appeared with PHP 4.2.0 and the version on my server is only 4.0.5!!!!! So how did people manage to automate their script before 4.2.0????
Thanks for replying
Yann

stolzyboy
08-11-2003, 11:46 AM
like you said, "cron", it is pretty easy

yannLH
08-11-2003, 12:07 PM
yes I suppose with the CLI module, il should work perfectly well. But without it... the problem is to lauch the execution of the script from command line.

Fortunately (I hope ;o)), I've read somewhere that I could use Lynx to lauch the execution of my script. So I'll try this.

stolzyboy
08-11-2003, 12:47 PM
you don't even need to bother with Lynx, you can use wget to run the php page, something like

***** wget phppage.php

the syntax isn't correct, but this lets wget(program) run the phppage.php and voila

yannLH
08-12-2003, 07:27 AM
I tried wget on my own computer and it actually worked well but on the server this command does not exist
So I had to use lynx which finally worked but there's a trick : I had to specify a value for TERM. I write here my command line because I think it may help someone... some day...

* * * * * TERM=vt100 && /usr/bin/lynx -dump http://monUrl

Thank you for your help