PDA

View Full Version : Cron Jobs and PHP


Sjoerd
01-29-2004, 01:51 AM
I have a PHP script and i want to let it run every day automaticly by using the cron jobs. But when i enter the location of the .php file as command, i only receive errors.

How can i let the script run without errors?

S2S-Robert
01-29-2004, 10:02 AM
if you have a look at the following topic, you'll find an example of running a php script through cron:

http://www.directadmin.com/forum/showthread.php?s=&threadid=1523

DirectAdmin Support
01-29-2004, 10:19 AM
Hello,

Just enter:/usr/local/bin/php /home/username/path/to/file.phpas the command. A plain php script doesn't know how to execute itself unless it has the shebang line at the top (#!/usr/local/bin/php)

John

Sjoerd
01-30-2004, 03:21 AM
Thnx John!

Everything works fine now!