Task scheduler configuration on Windows

Hi ! I’m having issues getting SuiteCRM 's scheduled tasks to work.
I’m using suiteCRM on a Windows server.
I created a batch file containing these two line as they appear in my Sheduler’s page :
image
Then I sheduled this file to be run every 5 minutes on window’s job scheduler. The job is running successfully.
But it doesn’t change anything in SuiteCRM, none of the scheduled tasks are launched.
I Don’t know if I missed Something…

I also tried running these lines :
image
Because my php-manager shows a different .exe file :
image
But it still doesn’t work…

I hope someone here can help me :slight_smile:

Could it be just the missing quotes around the executable name? Since the path has spaces, I think you need to use quotes:

Try

"c:\Program Files (x86)\PHP\php-cgi.exe" -f cron.php

or

"c:\Program Files (x86)\PHP\php-cgi.exe -f cron.php"

So… I tried

‘C:\Program Files (x86)\PHP\php-cgi.exe’ -f ‘C:\inetpub\wwwroot\SuiteCRM\cron.php’

and

“C:\Program Files (x86)\PHP\php-cgi.exe” -f “C:\inetpub\wwwroot\SuiteCRM\cron.php”

and

“C:\Program Files (x86)\PHP\php-cgi.exe” -f C:\inetpub\wwwroot\SuiteCRM\cron.php

and

‘C:\Program Files (x86)\PHP\php-cgi.exe’ -f C:\inetpub\wwwroot\SuiteCRM\cron.php

… and still Nothing works :slightly_frowning_face:

Let’s try and identify whether the problem is with the php install or with the cron task itself. Therefore:

cd into C:\Program Files (x86)\PHP\ and have a look to see if there are any other php based exe files. You may find that there is a command line php.exe or php-cli.exe file depending on where you installed php from.

From the command line, can you try the alternative php executables with the -f cron.php arguments from within:
C:\inetpub\wwwroot\SuiteCRM\

as cron.php relies on certain paths being relative to the cron.php file.

Your cron task is normally:
cd C:\inetpub\wwwroot\SuiteCRM
php cron.php

Where your php executable is in your $PATH

If this is the problem, then you’ll see progress of the task in the console. After trying this, check whether the suiteCRM interface shows that the scheduler has run.

Can you also tell us whether you installed the php separately, or as part of a WAMP (or other bundled installation)?

Ok so I tried my comand line in Windows PowerShell, and here’s what it says
image
image

I tried both php executables, but they are showing different error messages, so I Don’t know which one is the right one…

Sorry, I read your message again, and I’m trying to Apply what you said…
So I dit it like that :
image

It seems to be working, I’m not sure which one worked :laughing:

Basically cron.php is relying on the other files being in the correct directory relative to the directory that you’re calling from.

The correct one is php.exe (as this is the command line one) php-cgi (is php …common gateway interface) which provides php parsing and interpretation capabilities to daemons such as your web server.

Ok well, I updated my batch file to

cd C:\inetpub\wwwroot\SuiteCRM
."\Program Files (x86)\PHP\php.exe" -f cron.php

It’s running successfully every one minute in window’s task scheduler, but it doesn’t seem to work. It does not appear in suiteCRM task scheduler…

So I tried running the batch file in Windows PowerShell, and here’s what it says :
image
Sorry it’s in french, I Don’t know how to change that, it means “cannot find the specified path”

cron.php is the overriding controller that runs the tasks that you see in your scheduler…

In the suiteCRM web interface go to Admin->Scedulers.
You will see a range of tasks that that cron runs - If you select one of them, you’ll see a log of previous runs

It needs to be:

“C:\Program Files (x86)\PHP\php.exe” at the beginning - You missed the drive letter at the beginning.

En français, ça me convient, mais gardons-le en anglais pour le bénéfice de tous.

What I meant was the tasks Don’t run


The 3 runs appearing are those I lauched from the shell…

That’s because it’s the only way I could get it to run …
If I leave the drive letter, there’s another error :slightly_frowning_face:

That’s what I expected - you need to correct the scheduler.bat as outlined above, and include the full path to the executable, INCLUDING THE DRIVE LETTER :grinning:

Ok I got it, this seems to work

cd C:\inetpub\wwwroot\SuiteCRM
“C:\Program Files (x86)\PHP\php.exe” -f cron.php

It works ont the shceduler too, thanks a lot :smile:

Come on…

Your scheduler.bat should be:

-----------------8X-------------------
cd C:\inetpub\wwwroot\SuiteCRM
“C:\Program Files (x86)\PHP\php.exe” -f cron.php
-----------------8X-------------------

Path does not have a \ in front of it.

YAY - a little more painful than it should have been - but we’ve got there :grinning: