0

I want to follow this tutorial to learn about creating CRON jobs in PHP.

Two things:

  1. I am working on a Windows Machine. But the tutorial says,

    The cronTab, or "Cron Table", is a Linux system process / daemon which facilitates the scheduling of repetitive tasks thereby easing up our day to day routine.

    So does this mean that it will Not work on Windows machines?

  2. I have read that SSH2 is only available for PHP versions which are older than PHP 7.0.

    I currently have PHP 7.0 So the question is that should I downgrade my PHP (that is uninstall this version and install PHP 5.6) to use this extension.

My ultimate purpose to create a CRON job to keep monitoring a directory for the presence of a certain type of files. When a file is found, it is opened and useful data is extracted from it and loaded into the database.

Solace
  • 7,868
  • 17
  • 74
  • 162
  • 1
    Is your machine the same machine as the one you're trying to install the cron job on? Or are there two separate servers? Why do you want to use PHP to manipulate cron jobs instead of just editing them manually? I can't really see why I would ever have the need to automate cron job editing; it's not something I do several times a day. – Mike Nov 14 '16 at 18:14

1 Answers1

1
  1. cron is the Linux scheduled task. Windows has Task Scheduler you can use instead, to run your scripts on a schedule
  2. SSH2 is a PECL extension. You'll note there is a precompiled DLL for Windows listed. Be sure to install 1.0

    ssh2 1.0 and above is PHP 7 only

Community
  • 1
  • 1
Machavity
  • 28,730
  • 25
  • 78
  • 91