1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I run PHP scripts from windows & set cronjobs for them?

Discussion in 'PHP & Perl' started by oni3350, Sep 24, 2009.

  1. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:
    Hey,

    I know its possible to run PHP scripts on windows, I forget the exact name of the software that you need but ive done it before.

    If anyone can refresh my memory before I search google again that would be very helpful.

    Basically its some sort of platform that allows you to run PHP scripts through the "run" command or something. I think.

    But once I have that figured out, I want to be able to run these scripts in the BACKGROUND of my computer without any pop ups or anything using cronjobs or something very similar.

    See I think windows has a built in feature that allows you to set up a time for when you want certain actions to run, I could even set up a Marco to do this, But I really want to be able to do all of this but have it running in the background with no pop ups or anything.

    Is this even possible?
     
  2. oni3350

    oni3350 Regular Member

    Joined:
    Sep 24, 2008
    Messages:
    361
    Likes Received:
    194
    Occupation:
    Internet Marketer/ Black Hatter
    Location:
    Perth, Western Australia
    Home Page:
    Ok i have gotten myself easy php and have now been running scripts from my homw computer.

    Soon i will try and find out how to automatically run these scripts in the background of my computer.

    If not, i guess i can just manually start them each time.

    But the thing is, i am running these scripts from my home DSL connection because i have already had my hosting IP banned ( i think )

    So being able to run these scripts on my home PC and changing my IP all the time will be fine right? I can stay undetected right??

    Or are there others things about running PHP scripts from a home computer that can be left behind???
     
  3. kaidoristm

    kaidoristm Power Member

    Joined:
    Feb 13, 2009
    Messages:
    561
    Likes Received:
    727
    Occupation:
    Freelancer
    Location:
    Estonia
    Home Page:
    To setup a Windows machine to run cron.php at a specific time follow the specific instructions below. This can be useful if you are not familiar with Linux/Unix, or if your web host does not offer the ability to run cron jobs; you can run them remotely from your own computer.
    Note: These instructions were written for Windows XP but should be similar in other versions of Windows.
    Creating a Scheduled Task

    1. Open Scheduler
    2. Go to Start > Programs > Accessories > System Tools > Scheduled Tasks
    3. Double-click Add Scheduled Task
    4. The Scheduled Task Wizard will appear. Click Next.
    5. Select the program to run. Choose your browser from the list (for example, Internet Explorer or Mozilla Firefox). Click Next.
    6. Give the task a Name, such as Drupal Cron Job, and choose the Frequency with which to perform the task (for example, Daily)). Click Next.
    7. Choose specific date and time options (this step will vary, depending on the option selected in the previous step). When finished, click Next.
    8. Enter your password if prompted. Change the username if required (for example, you'd like the task to run under a user with fewer privileges security reasons). Click Next.
    9. On the final page, select the checkbox Open advanced properties for this task when I click Finish and click Finish.
    Configuring the task

    1. Go to the task's setting page either by checking the checkbox at the end of the last step, or by double-clicking on the task.
    2. In the Run box, after the text that is there now (for example, C:\PROGRA~1\MOZILL~1\firefox.exe), enter a space and then type the address to your website's cron.php page in double quotations (for example, C:\PROGRA~1\MOZILL~1\firefox.exe http://www.example.com/cron.php
    3. To set a frequency more often than Daily (for example, hourly), click the Schedule tab, then click Advanced. Here you can set options such as Repeat task, every 1 hour for 23 hours. Click Ok when finished.
    4. Change the start time on the task to one minute from the current time. This will allow you to test the task and make sure that it is working.
    5. When all settings have been configured to your liking, click Apply and OK (note: you may be prompted for your password)
    You can get wget here
    http://gnuwin32.sourceforge.net/packages/wget.htm