Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Cron troubleshooting guide (for Windows)

Author: Edward Hardin Reference Number: AA-00702 Views: 24107 Last Updated: 05/05/2017 02:38 PM 0 Rating/ Voters

If you haven't setup a cron job yet, you can do this now. How to setup a cron job?

If you're not sure if the cron job is running on your server, use this guide to troubleshoot this issue.

First of all, check if that is really the case - use this guide to check if cron job is set up and running. Once you are sure that cron doesn't work, proceed with the troubleshooting steps below to find out what caused that and how to fix it.

If the knowledge base opens via https only

If you're using an SSL certificate for secure connection (https), you need to add two lines to the cron.php file.

It is easy to check if you're using SSL. Simply take a look at the browser address bar when a knowledge base page is opened. If it starts with "https://", then you're using SSL. If you've got "http://" there, then you're not.


Check if the cron job is setup to run each 1 minute

Remember that if cron job runs less frequently than once per minute, KMP will still display that "You have to setup cron script..." message. So cron might actually be running correctly, just not as often as expected. Use the instructions below that match your Windows version to check how often cron is set to run on your system.

Windows XP/2003

Go to Start > Control Panel > Scheduled Tasks.

Right-click on the KMP cron task and click Properties.

Then click the Schedule tab on the window with cron task properties. You'll see the schedule.

Click the "Advanced" button.


Check that the Start Date is in the past and that all other settings are the same as on the screenshot above. Pay attention to the part marked on the screenshot. It is recommended to repeat the task every 1 minute.

Save the new settings and hold on a minute. Then check if cron job is now working. If it still doesn't work, proceed to the next step.

Windows 7/2008

Open Control Panel and type "Schedule Tasks" into the search field.


You will see the "Schedule Tasks" link. Click on it.

Find the KMP cron task, right click on it and select Properties.

Click on the Triggers tab.

Select the trigger and click Edit.


Check that the Start date is in the past and that all other settings are the same as on the screenshot above. Pay attention to the part marked on the screenshot. It is recommended to repeat the task every 1 minute. Since there is no option "1 minute" in the selection list, it is a common issue when users select "5 minutes" instead.


You can simply type "1 minute" to the field and it will be accepted as a valid repetition period.

Save the new settings and hold on a minute. Then check if cron job is now working. If it still doesn't work, proceed to the next step.

Try to run cron from the command line

Now let's check if the cron.vbs file is valid.

Go to Start > All Programs > Accessories > Command Prompt.

Copy-paste the full path to php.exe with the two parameters from the cron.vbs (that is what you've got between quotation marks on the second line after WinScriptHost.Run).


Valid command usually doesn't generate any input like shown on the screenshot. So if you do not see any errors, it should be OK and you can proceed to the next step.

If an error has been displayed and you understand what the error means (for instance it may tell you that the path to php.exe is incorrect - so you need to adjust it), try to fix it. Then try to launch the updated command once again. If the error message is unclear, make a shot of your screen (you might need to send it to us for a research) and proceed to the next step. We've got some common errors explained below along with appropriate solutions.

Ensure that cron.vbs and php.exe are not blocked

Open properties of the php.exe file and cron.vbs and make sure that these files are not blocked.


If one of these files is blocked, click the "Unblock" button to unlock it.

Check if the URL to KMP has a trailing slash

Open the cron.vbs and check if the last parameter on the second line - the URL to KMP has a trailing slash.

This is correct:

WinScriptHost.Run "C:\PHP\php.exe c:\inetpub\wwwroot\kmp\admin\CRON\cron.php http://www.yourwebsite.com/kmp/", 0

This is incorrect:

WinScriptHost.Run "C:\PHP\php.exe c:\inetpub\wwwroot\kmp\admin\CRON\cron.php http://www.yourwebsite.com/kmp", 0

 If the trailing slash is missing, add it, save the cron.vbs file and check if cron is working normally now.

If paths contain spaces

If the path to php.exe or to cron.php contains spaces, it is necessary to take that path into double quotes:

Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run """C:\Program Files\PHP\php.exe"" ""C:\Inetpub\Some Folder\kmp\admin\CRON\cron.php"" http://www.yourwebsite.com/kmp/", 0
Set WinScriptHost = Nothing

The matching pairs of quotes are shown in the same color in the example above for your convenience.

Enable the error log

Enable the error log, then try to run cron job once again. Check if anything has been added to the log file, which is located in the /admin/tmp/ directory.

If this guide haven't helped or you have any questions feel free to contact our Support Team. Please attach the error log file and the screenshot of the output produced by the cron.vbs file to your email. This will help us to resolve the issue faster. Thank you.

Custom Fields
Applicable to these operation systems:Windows