Page 1 of 1

Using Cron with PHP

Posted: Sat Nov 02, 2002 12:35 am
by MerlinCorey
I work for a site with a couple of online games (second link in my signature) and we've decided to use Cron to update the information... I have experience with crontab itself and I have set it up properly (meaning the dates and times to run the file); however, it generates errors when running the file (crontab emails me after each run with the results)... I simply used the location of the file as the program to run and it seems to not want to run .php ...

Basically, is there a way to set it up so that it DOES run the php file as expected or should I run it in a browser (I've just this minute set it to execute "lynx myfile.php")..? And if the browser solution is the way to go, does it automatically close lynx after the page is loaded..? This is necessary as we are hosted elsewhere and I don't believe we're allowed any background processes...

Thanks in advance, if the lynx method works, I'll post back...

Posted: Sat Nov 02, 2002 1:11 am
by MerlinCorey

Code: Select all

Your Terminal type is unknown! 

  Enter a terminal type: їvt100] 
TERMINAL TYPE IS SET TO vt100 
(B)0ї1;24rїmї?7hї?1h=їHїJї21Bї0;7mGetting file://localhost/home/path/to/the/fileїm 

ї24;1H ї?1l>
That's what it told me after it executed with the lynx line... :?

Apparently lynx doesn't want to run outside of a terminal... Stupid lynx... :p

Posted: Sat Nov 02, 2002 4:06 am
by volka
topic e.g. covered at viewtopic.php?t=2480 ;)
try

Code: Select all

/usr/bin/php -f /home/buyourstuf/www/onslaught/sources/update.php

Posted: Sat Nov 02, 2002 5:43 am
by MerlinCorey
Thanks... We'll see in about 20 minutes... :)

Posted: Sat Nov 02, 2002 1:39 pm
by MerlinCorey
Worked like a charm...

Posted: Sun Nov 17, 2002 7:29 pm
by m3mn0n
i have a similar issue:

i had it working before

i used the -l command and it worked great

i recently changed directories for my game, and i want to reactivate it and disable the old entry, i went ahead and did the same command as before and its not working, anyone know what could be wrong?

thanks.