Forum Moderators: phranque

Message Too Old, No Replies

Schedule a PHP Script

Scheduling PHP scripts on Apache

         

cobnut

1:03 pm on Feb 28, 2007 (gmt 0)

10+ Year Member



Hello, I'm running Apache 2.2 and PHP 5 on Windows XP to provide a 'stats' intranet for our company. At present the data for these stats is in CSV form so needs a regular 'import' into MySQL (5). I have PHP scripts that do this but am tearing my hair out trying to find out how to schedule these to run in an efficient manner.

1) I can use Windows scheduler to launch a browser, but that leaves the browser open on completion.

2) I can't use Linux/Unix much as I'd like to, that's simply not an option in this environment.

Isn't there some dead simple way to get Apache to run a specified PHP script at a specified time, doing so 'silently'?

I really have been Googling like crazy and while having found various answers all seem to rely on Unix, cron or other options not apparently available to me. Any help greatly appreciated.

Jon

milanmk

2:42 pm on Feb 28, 2007 (gmt 0)

10+ Year Member



Did you tried calling a Batch file via Task Scheduler?

I mean something like adding php c:\test.php in a Batch file and then scheduling it?

Also try php -help from the command prompt and you will find many other options.

Milan

bcolflesh

2:48 pm on Feb 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You don't have access to a crontab on the *nix machine? Contact the admin and have them setup an entry for you to run your script.

cobnut

3:04 pm on Feb 28, 2007 (gmt 0)

10+ Year Member



Thanks Milan, that's exactly what I needed.

I knew it would be something dead simple. Many thanks, that works fine.

Jon