e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

Cron.php doesnt appear to work correctly on Windows Host. #828

Closed KSSilence closed 6 years ago

KSSilence commented 9 years ago

Hi! There appears to be an issue trying to get cron.php jobs to work on Windows based OS's such as Server 2012 R2 in my case. It doesnt matter what method i try (Sched Tasks, Manual Execution, nnCron, cURL, etc,) The cron task just doesnt seem to execute and fails silently. when i refresh the Cron page it always says that i need to check if cron.php is executable (which it seems to be because manual attempts to run it with PHP dont return errors) and that the cronjob has never been run before.

Im at a loss as to what to do now to get this to work. It seems the syntax of the command isnt formatted as best as it could be with the cron password being separated by a space from the filename (which means some methods such as cURL complain because of the space) when you could possibly use .php? instead?

Some server info: Machine OS: Server 2012 R2 Webserver: Apache x64 PHP x64 MySQL x64 CMS: e107v2

Most other parts of the site seem to work fine, just cronjobs and anything dependant on them doesnt. It would be preferable to use local execution of the file (which the command suggests: "Use the following Cron Command: C:/Webserver/htdocs/4th-id.net/cron.php ") rather than having to do it over http.

Thanks.

ghost commented 9 years ago

Hi.

This is because Windows does not natively support cron. You should refer to this article on stackoverflow and do some research into the programs mentioned or pass it along to your system administrator.

KSSilence commented 9 years ago

Thanks mate but I've already been down that road with various attempts from task scheduler to various cron tools for windows all with the same result. Also the VPS is mine lol, I am THE Owner / head Administrator.

KSSilence commented 8 years ago

Bump, Has there been any progress yet?

Still cant get this cron.php to run using the various method that most recomend for windows which is executing it via php.exe / php-win.exe (the latter is headless) C:\Webserver\PHP-x64\php.exe -f C:\Webserver\htdocs\4th-id.net\cron.php

php appears to execute (shows in task manager very briefly) and doesnt return any errors (when run manually from cmd)

i suspect it may be because e107 vs requires a dammed cron password to be paresed as an argument and php.exe / php-win.exe may not support doing that and fails silently?

either way i run it via tasksched or manully and as far as the admin panel is concered it keeps telling me to make sure its executable and the last update was "never"

CaMer0n commented 8 years ago

@KSSilence The e107 cron.php can be sent the pwd/token in a few ways.

cron.php {token}

or

cron.php token={token}

or

cron.php?token={token}

Have you tried all of these methods?

KSSilence commented 8 years ago

@CaMer0n I tried all 3 today and same thing.

First one was what i was always trying, Fails silently Second one i tried it and appeared to silently fail as well

the third method wont work with php.exe because PHP.exe thinks its part of the filename and throws a wammie that it cant find it (presumably because of no space and interprets different to a broswer?).

i even tried executing https://www.4th-id.net/cron.php?token={token} in a broswer which resulted in blank page (expected?) and the admin panel still says that cron has never run.

is there a way of removing the token requirement atleast for testing or somehow getting some logs / error msgs from trying to execute it? afaik i havent seen any other cron.php's that need a token when doing researching.... ?

CaMer0n commented 8 years ago

@KSSilence Yes, just try enabling it without any token or query. It should send an email with variables etc. so we can see what is going on.

Moc commented 7 years ago

@KSSilence did you manage to get this working?

CaMer0n commented 6 years ago

@lonalore thoroughly tested and documented setting up crons. Closing this entry.