2

How can I set up Magento 2 cron jobs to work on a Windows server?

I can make the cron tasks run in a similar way to this or by calling the file directly (as far as I can tell this works).

yoursite.com/update/cron.php

However when trying to do extension installs Magento thinks that the cron process is not running (Magento docs on this issue). How can I make it know it is running?

1

If you want to run cron job directly without having to wait for the schedule, you can use

n98-magerun2 sys:cron:run <job name>
1

I used "Task Scheduler" within Windows to achieve this. I create a task that ran every 5 minutes and for the action I set the following:

Program/script: C:\xampp\php\php.exe

Add arguments (optional): C:\xampp\htdocs\magento2\bin\magento cron:run

The annoying thing about this is that you'll see php.exe pop up every time the cron runs. There's a work around for that, by changing the script to run as system. There's a guide on how to do that here.

0

This can be solved by running the correct command line task from the base magento install directory.

setup:cron:run

Make sure that your installs all use the same version of PHP and that the XSL extension is enabled otherwise this will cause issues as well.

0

You can simply run the following command line:

php magento-installation-directory/bin/magento cron:run

You can also create cron job to run at a certain time interval if u dont want to run this command manually everytime

  • Is there anyway to run this same command from the browser do you know? – tim.baker Sep 8 '16 at 12:13
  • yes.First go to ur magento admin panel.Then go to stores->configuration->advanced->system.Now under cron(Scheduled tasks) u can configure cron job – seilena Sep 8 '16 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.