How to make a cron..?

Corey

New member
Joined
Jan 23, 2007
Messages
4
So, I've been trying to get my cron to run a php script, but it will not work. I google'd it and tried all different methods; but nothing seemed to work.

I added this to the top of my php script;
Code:
#!/usr/local/bin/php

Here is what my admin panel looks like for setting up a cron;
http://img247.imageshack.us/img247/8080/mysqlcron3cf.png
As you can see.. I tried different methods there, as well.

Thanks for any help.
 
Keep these points in mind:

The cron job will be run as the user and using the user's environment. So you'll need complete paths for everything in the script.

You'll need to make sure you have command-line php installed, as cron jobs do NOT use the php functionality built into apache.

To test:

First temporarily turn on ssh for the user.

Then log into the shell as the user (you can use su - if you want, but do not use su without the - character.

Then run the cronjob exactly as typed into the cronjob.

See what errors, if any, you get.

jeff
 
Erm; I may have posted this in the wrong place then.. but I am not a provider. I bought my hosting and only have access to direct admin. I am not the actual host.
 
Then you should probably ask your provider; they can most likely help you.

Jeff
 
Back
Top