Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 05-09-2004, 05:08 PM   #1 (permalink)
tzarin
Registered User
 
tzarin's Avatar
 
Join Date: May 2004
Posts: 2
tzarin is on a distinguished road
running a script at designated time

Im working on a game which requires a script to be run each hour (i.e. each hour this script is run which updates the game information). This type of game is called a 'tick-based' game if that helps.

I am trying to find out how to do this, do I need a seperate program running on my server which calls this script every hour and if so how do I go about doing that?

Im just looking for someone to point me in the right direction on this one. Thanks in advance to anyone who can help.

Cheers.
tzarin is offline   Reply With Quote
Old 05-09-2004, 05:15 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
what type of system is the server? if linux, then you will have to schedule the script to run with cron. here is a tutorial that bdl wrote for that:( http://codenewbie.com/tutorials/716.html ) if you are using windows, i think you can use 'scheduled tasks'

good luck!
__________________
Mike
sde is offline   Reply With Quote
Old 05-10-2004, 04:41 AM   #3 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
In addition to cron, I believe you'll need a php version that's compiled as CLI binary. (not just an apache module) Otherwise you'll have nothing to run it with.

-r
idx is offline   Reply With Quote
Old 05-10-2004, 05:09 PM   #4 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
Quote:
Originally posted by idx
In addition to cron, I believe you'll need a php version that's compiled as CLI binary. (not just an apache module) Otherwise you'll have nothing to run it with.

-r
Yes and no. In my experience, the PHP binary exists regardless of whether or not you install PHP as an apache module or standalone CGI. If you can 'see' the php executable in your PATH (or /usr/local/php/bin/php, wherever your php installation is) then you can use that binary in your shell script.
bdl is offline   Reply With Quote
Old 05-11-2004, 04:48 PM   #5 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
Quote:
Originally posted by bdl
Yes and no. In my experience, the PHP binary exists regardless of whether or not you install PHP as an apache module or standalone CGI. If you can 'see' the php executable in your PATH (or /usr/local/php/bin/php, wherever your php installation is) then you can use that binary in your shell script.
Perhaps an OS issue. In FreeBSD if you don't compile from /usr/ports/lang/php4 (vs /usr/ports/www/mod_php4), you wont get the binary.

-r
idx is offline   Reply With Quote
Old 05-12-2004, 07:11 PM   #6 (permalink)
tzarin
Registered User
 
tzarin's Avatar
 
Join Date: May 2004
Posts: 2
tzarin is on a distinguished road
Just what I was looking for, thanks to you all!
tzarin is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adjusting date() function for time zones Epsilon PHP 1 02-27-2004 02:55 AM
sde, changing directory script is running in? Admin PHP 2 06-23-2003 12:02 PM


All times are GMT -8. The time now is 10:00 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting