[horde] horde-alarms on windows
admin at wap.dynu.net
admin at wap.dynu.net
Thu Jun 17 16:18:29 UTC 2021
Hello. This is not a question. Its just a write up of how I got
horde-alarms to work on windows. I hope it can be helpful to someone in
the future. Horde is very linux oriented but there are a few nutjobs
like me that run it on windows. :)
My problem was that pear, for reasons unknown to me, does a partial
install into C:\php (which didn't exist before installing horde via
pear) instead of the correct location C:\xampp\php. This causes path
issues. I could not overcome that but I found a workaround. Other than
this horde-alarms issue, my horde installation is fully functional.
My environment: Windows 10 with XAMPP (php 7.3)
1) Sort out environment variables. Make sure PHP_PEAR_SYSCONF_DIR is set
to php folder. In XAMPP the default is C:\xampp\php
Pear.bat:
REM Check PEAR global ENV, set them if they do not exist
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET
"PHP_PEAR_INSTALL_DIR=C:\xampp\php\pear"
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=C:\xampp\php"
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\xampp\php\php.exe"
IF "%PHP_PEAR_SYSCONF_DIR%"=="" SET "PHP_PEAR_SYSCONF_DIR=C:\xampp\php"
2) Copy horde-alarms from default location (C:\xampp\php) to the horde
base folder. For me, that's X:\xampp\htdocs\horde
3) Alter line 15 of horde-alarms to the fixed path of
/lib/Application.php:
$baseFile = 'X:\xampp\htdocs\horde\lib\Application.php';
This is the workaround and it does work. I now get reminder messages.
4) Run a batch file to launch horde-alarms from windows task scheduler.
This is optional. Everything still works without it, but running from
the batch file will result in windows task scheduler "last run result"
of 0x0 ("operation completed successfully"). If the task runs php -f
horde-alarms directly, the last run result will be 0x1 due to php
outputting the following:
admin at SERVER c:\xampp\php
# php -f X:\xampp\htdocs\horde\horde-alarms
The system cannot find the path specified.
The system cannot find the path specified.
I still haven't been able to fix that, however, it doesn't seem to do
any harm. Everything functions, including horde email reminders, despite
this error/warning. Therefore you can decide whether to call
horde-alarms directly or through a batch file with the only difference
being with or without an error thrown in windows task scheduler at the
completion of the task.
horde-alarms.bat:
@echo off
echo %date% %time% 1>>C:\xampp\php\horde-alarms.log
C:\xampp\php\php.exe -f X:\xampp\htdocs\horde\horde-alarms
1>>C:\xampp\php\horde-alarms.log 2>>&1
If you don't want the logging, just delete it from the batch file. It
was useful in sorting this out, but its just logspam now.
That's it. I hope this helps someone else out.
More information about the horde
mailing list