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
https://forums.phpfreaks.com/topic/166931-running-php-scripts-at-times/
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?

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.

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?

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.