Jump to content

Running PHP scripts at times


n14charlie

Recommended Posts

Hello

 

I need a php script on a server to run every end of an hour.

The only thing I was able to find about how to do this is called "Cron Jobs" which

is a feature of the web server, is there another way? or the only way to do this

is this feature supported by the server.

 

thank you

Link to comment
Share on other sites

Does the script need to be run if the site is not being visited by anyone?

 

If not you could create a script to run in the background and create a sort of queue using the time function to update a db field or write to a file and create a loop to run the relevant code for every hour since it was last run?

Link to comment
Share on other sites

Can anyone tell me if there's a way to simulate cron jobs on my desktop (I'm using windows) .. I need all of this for a project of a web application Im building.

 

edit: I mean, simulate Linux cron jobs on windows so when I need to put it on a real server I will able to.

Link to comment
Share on other sites

Can anyone tell me if there's a way to simulate cron jobs on my desktop (I'm using windows) .. I need all of this for a project of a web application Im building.

 

edit: I mean, simulate Linux cron jobs on windows so when I need to put it on a real server I will able to.

 

Did you see the article I just posted showing you how to install a Centos Linux server on your Windows machine in a Virtual machine using Sun's free Virtualbox?

Link to comment
Share on other sites

you can do this using windows scheduled tasks.

 

RUN:path to php.exe filename

 

START IN: path to location of file

 

RUN AS:pcname

 

you must set a password here if you need to login to your desktop

 

example:

 

RUN:C:\htdocs\php\php.exe myfile.php  <--there is a space between path and filename

START IN:C:\htdocs\awesomeproject\includes

RUN AS:HOMEPC\username

 

click on the checkbox for enabled

change tabs for the scheduling and settings.

 

Hope this helps out.

Link to comment
Share on other sites

Can anyone tell me if there's a way to simulate cron jobs on my desktop (I'm using windows) .. I need all of this for a project of a web application Im building.

 

edit: I mean, simulate Linux cron jobs on windows so when I need to put it on a real server I will able to.

 

Did you see the article I just posted showing you how to install a Centos Linux server on your Windows machine in a Virtual machine using Sun's free Virtualbox?

 

I think this is what I need, thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.