[dev] kronolith. how to test if libmcal is working.

Max Kalika max@the-triumvirate.net
Sat, 21 Apr 2001 22:20:51 -0700


Quoting Atif Ghaffar <aghaffar@developer.ch>:

> I dont know if its kronolith's fault or libmcals fault.

Most likely its the fault of libmcal.  I had two problems with it on Friday and 
Chuck patched the install to fix one of them.  So make sure you have the latest 
CVS of libmcal before you built php.  Also make sure you nuke the -DUSE_PAM 
(which is probably what is causing your current install to fail) flag from 
mstore's makefile (I also took off -DDEBUG).  Before testing mcal, make sure 
you have an /etc/mpasswd file which contains a colon seperated 
username:password line.  You can generate this with the htpasswd command or, in 
absense of that, the following commandline:

perl -e 'print "login:", crypt("password", "23");' > /etc/mpasswd

(change "login" to a username you'll use for Kronolith, change "password" to 
that username's password, and change "23" to any random two characters you want 
to use for a salt)

Make sure that file has world read permissions (644).

Make sure the /var/calendar directory exists and contains world write 
permissions with sticky bit set (1777).  Or if you're planning on just running 
mcal via Kronolith, set the ownership of this directory to your webserver user 
(http for me) and make permissions 700.

Once all that is set, you can test if libmcal is compiled into php correctly 
with something like this:

<?php

error_reporting(E_ALL);
$mcal = mcal_open('{/mstore}<blah>', 'login', 'password');
var_dump($mcal);

?>

If all is right, you should get a var_dump result of int(1).  Otherwise, you'll 
get a warning about not being able to open stream.

Good luck!

-- 
/// max kalika
// max@the-triumvirate.net

"and after a while you'll stop making computers out of stuff and start making 
stuff out of computers" -- douglas adams 4/5/01