PHP/Cron related question…. plz help
-
Hi
I made an small php script what parses squid logs for me and sends the data via an ssh2 connection to an mysql server….
everything works nice so far, the only problem i have is i cant run the php script via an cron job....
i tried....
1 php -q /testfolder/test.php
2 fetch /testfolder/test.php
3 sh /testfolder/run.shthe /testfolder/ is located in my root directory
it would be really nice if someone could help me out with this problem.....
sorry for my bad english
Zasa
-
Try calling php with the full path:
/usr/local/bin/php -f /testfolder/test.php
Steve
-
Schedulle it using cron package and don't forget the full path just like stephenw10 said.
Some debugs to text files may help you finding out What is wrong.
-
hi again :)
thanks for your help… i sheduled it using the cron pakage but it still doesnt work,
it looks like this now
5 * * * * root /usr/bin/php -f /test/a.php
the cron pakage works (i tested it with an simple "reboot"), i also can start the php manualy just not with an cron job...
i ever made an similiar script on linux and there i got it running with "wget /testfolder/test.php" but i cant install wget on my router and fetch doesnt seem to work....
thanks again for your help...
zasa
-
You can install wget if you need it but I doubt it will help:
pkg_add -r ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-8.1-release/All/wget-1.12_1.tbz
Anyway you seem to calling php from the wrong directory, it's in /usr/local/bin.
Steve
-
You can install wget if you need it but I doubt it will help:
pkg_add -r ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/i386/packages-8.1-release/All/wget-1.12_1.tbz
Anyway you seem to calling php from the wrong directory, it's in /usr/local/bin.
Steve
hi steve
it works!! the problem was like you said that i called it from the wrong directory… i changed it and now it works :):)
thanks for you help :):) i own u one
Zasa
-
Your cron job is scheduled to run every hour at minute 5.
If What you need it every five minutes, change first value from 5 to */5
-
Your cron job is scheduled to run every hour at minute 5.
If What you need it every five minutes, change first value from 5 to */5
Hi
i set it to */5 just i didnt copy the whole line of text :)
Zasa :)