Jump to content

Setting up a scheduled task to run a PHP file


netfrugal

Recommended Posts

I would like to run a simple php file that backs up my database.  The file is in one of the virtual directories. 

I know I can do it with other ways, but I'm interested in how to do it on a windows OS, and using the windows scheduled tasks wizard - if possible.

I've read that parameters need to be set up, but I don't quite understand what that means.

Does anyone know how I can do this in a simple step by step fashion?

thanks!
Link to comment
Share on other sites

Got it figured out!

The best way to do this is to create a batch file that includes php.exe and the php file that needs to be executed:

C:\php\php.exe C:\apache2\htdocs\emailscript.php

then I set up the scheduled task to run the .bat file when I need it.

Next thing to figure out is how to set up a cron job on linux to do the same thing.
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.