I've been trying (all day!) to get PHP
to work with some version of libmcrypt,
so I can do a simple DES operation. It
doesn't work.
Has anyone ever gotten PHP to work
with libmcrypt with OpenBSD? Here
is what I have tried:
- Install libmcrypt2.4.4. Someone
on the PHP manual said that it didn't
work with 2.4.10, and that 2.4.4 does
work, so I installed that in the normal
way:
./configure --disable-posix-threads
make
make install
Everything went fine, and files
were place in /usr/local/*.
Next step, compile PHP:
./configure --with-pgsql --with-mcrypt=/usr/local --with-mhash --with-mm --with-apxs
It works fine.
Next,
make
and I get a whole bunch of errors:
make[3]: Entering directory /space/hh/php-4.0.4pl1/ext/mcrypt'
/bin/sh /space/hh/php-4.0.4pl1/libtool --silent --mode=compile gcc -I. -I/space/hh/php-4.0.4pl1/ext/mcrypt -I/space/hh/php-4.0.4pl1/main -I/space/hh/php-4.0.4pl1 -I/usr/lib/apache/include -I/space/hh/php-4.0.4pl1/Zend -I/usr/local/include -I/space/hh/php-4.0.4pl1/ext/mysql/libmysql -I/space/hh/php-4.0.4pl1/ext/xml/expat/xmltok -I/space/hh/php-4.0.4pl1/ext/xml/expat/xmlparse -I/space/hh/php-4.0.4pl1/TSRM -DDEV_RANDOM=/dev/arandom -DMOD_SSL=206106 -DEAPI -DUSE_EXPAT -DXML_BYTE_ORDER=12 -O2 -c mcrypt.c
mcrypt.c:222: warning:MCRYPT_FAILED' redefined
/usr/local/include/mcrypt.h:28: warning: this is the location of the previous definition
mcrypt.c: In function php_minit_mcrypt':
mcrypt.c:260:MCRYPT_BLOWFISH_448' undeclared (first use in this function)
mcrypt.c:260: (Each undeclared identifier is reported only once
mcrypt.c:260: for each function it appears in.)
mcrypt.c:261: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast
When I looked at the mcrypt.c code at line
222, it looks like LIB_MCRYPT22 is defined.
Obviously, it should be 24, not 22. I
tried to manually insert #define for 24,
and that didn't work (gave a lot of syntax
errors). I tried to modify ./configure
so that it would force detection of 24.
That didn't work.
Any tips? Has anyone ever gotten this
to work? Any alternatives to mcrypt?
All I need to do is a simple DES encryption.
Has anyone ever ported DES itself to
PHP?
Thanks. Please email me or post.