Help - Search - Members - Calendar
Full Version: PHP as Cron
Hostony Board > General Support > PHP/MySQL
Niakie
Hey guys,

I was sure I had seen something in here about running a PHP script as a cron job, but I can't find it now. What I would like to do is run a script once a week. I have the script made, and I know how to set the cron job itself up, but what would the command be to run it?

Thanks
dholden
I think that <path>/<file>.php would do it.... where <path> is your path, and <file> is your file name...
Alexandre
For example:
/usr/local/bin/php /home/username/public_html/path_to_file/test.php
Niakie
Great! I set that up and will find out if it works on Sunday when it runs next smile.gif Thanks guys!
Alexandre
No problem! smile.gif
Nihilist
if it doenst let me know im running a few cron jobs successfully on a php script
Alexandre
If you want you can do it.
Xion
I'm trying to use this as my command: php /usr/local/bin/php/home/limiteds/public_html/path_to_file/file.php

But it doesn't seem to be working, any ideas ?
Niakie
After finnally getting it straight lol heres what you need to use


CODE
/usr/local/bin/php /home/limiteds/public_html/path_to_file/file.php


basicly ist the path to the php instilation followed by a space then the path to the file you wish to run... I got mine set up and its working wonderfully now!
Xion
ah, I had missed a space, thank you smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here