This requires LibPEM v0.1.1, grab it at my homepage:
 http://undead.thegraveyard.org/?topic=softies

1) First run ./setup.

2) Then add the LibPEM, Apache and PHP3 include dirs to the CC
   statement in the Makefile.
   (eg. CC = cc blablabla -I/usr/local/pem -I/usr/include/apache
             -I/usr/src/php-3.0.15)

3) Then run 'make' and copy pemphp.so to your PHP3 loadable module
   directory...

It should be set up now... (btw. This was only tested on Linux using
PHP-3.0.15. AND NO, IT DOESN'T WORK WITH PHP4!)

Greetings,
The UnDEAD =)