News:

Join the Facebook Fan Page.

Main Menu

Cron jobs

Started by umiya, September 16, 2004, 11:42:40 PM

Previous topic - Next topic

umiya

Im trying to creat one on my  site and i cant get the darn thing to work

this is what i have in the command line

/usr/bin/php rpg/turns.php

anyone have any ideas for me?

[Unknown]

#1
You have to give the full path to rpg/turns.php.  For example:

/home/umiya/public_html/rpg/turns.php

I think you might also have to use -f, like:

/usr/bin/php -f /home/umiya/public_html/rpg/turns.php

Another method (sometimes better) is to use wget, like so:

wget -q -O - http://www.yourdomain.tld/rpg/turns.php

-[Unknown]

Parham

the php program also needs the shebang line in it because your running it from the shell

#!/usr/local/bin/php (or wherever it is)

if you use wget, you won't need the shebang line in it though...

umiya

wget -q -O - http://www.yourdomain.tld/rpg/turns.php

ill try this and post update :)

[Unknown]

Quote from: Parham on September 17, 2004, 12:20:38 AM
the php program also needs the shebang line in it because your running it from the shell

#!/usr/local/bin/php (or wherever it is)

if you use wget, you won't need the shebang line in it though...

Actually, that's only if you +x it and try to run it directly.  If you call it with /usr/bin/php, it doesn't need the shebang.

-[Unknown]

umiya

#5
tried it and this is what i got in email

bin/sh: line 1: /usr/bin/wget: Permission denied


lol i jsut noticed something

does

wget -q -O - http://www.yourdomain.tld/rpg/turns.php

the part in bold have to be there?

[Unknown]

Actually, www.yourdomain.tld was an example.  The tld stands for "top level domain", which is like .com, .org, etc.  Here, that part would be www.simplemachines.org.  No tld ;).

You don't seem to have permission from your host to use wget.... that kinda sucks.  You might want to ask them why this is, but maybe using php directly will be better.  You can also try the "fetch" command, or "curl" - if those aren't denied.

-[Unknown]

umiya

well heres what i jsut tried

/usr/bin/php -f /infinite/public_html/rpg/turns.php

and this is what i got back


No input file specified.


[Unknown]

Are you sure it's not /home/infinite?  Remember, this is your FULL path, not relative to your website or your FTP.

-[Unknown]

umiya

/usr/bin/php -f home/infinite/public_html/rpg/turns.php
 

No input file specified.


still not working :(

[Unknown]

Try it with the first / - /home/...

-[Unknown]

umiya

#11
/usr/bin/php -f /home/infinite/public_html/rpg/turns.php

like so?

edit- whooooo hooooo thank you so much that did it :)

Advertisement: