MCrypt is a replacement for older crypt() package and crypt(1) command with extensions. It allows developers encryption functions, specifically allowing users to encrypt files or data streams.
Configuring MCrypt support for Mod_PHP can be a pain so hopefully this article will help!
The below was tested on a Centos 4.4 64 Bit server.
Package Dependencies:
libmcrypt-2.5.8.tar.gz
mhash-0.9.9
mcrypt-2.6.4
php-5.2.1.tar.gz
Installation Notes:
libmcrypt:
gunzip -c libmcrypt-2.5.8.tar.gz | tar xf -
cd libmcrypt-xxx
./configure --disable-posix-threads
make
make check (note: 'make check' is optional)
make install
added /usr/local/lib to ld.so.conf
ldconfig or LD_LIBRARY_PATH=/usr/local/lib
(Below is important)
cd libmcrypt-2.5.8/libltdl
./configure --enable-ltdl-install
make
make install
mhash:
ldconfig
gunzip -c mhash-0.9.9.tar.gz | tar xf -
cd mhash-xxx
./configure
make
make check (note: 'make check' is optional)
make install
mcrypt:
ldconfig
gunzip -c mcrypt-2.6.4.tar.gz | tar xf -
cd mcrypt
./configure
make
make check (note: 'make check' is optional)
make install
PHP:
gunzip -c php-5.2.1.tar.gz | tar xf -
./configure --with-apxs2=/usr/sbin/apxs --with-jpeg-dir=lib64
--BLAH --BLAH --BLAH --with-mcrypt=/path/to/mcrypt-2.6.4
(*NOTE the path of --with-mcrypt= install directory source code)
make
make install
This should get you up and running to use mcrypt!
The post Configuring MCrypt Support For Mod_PHP first appeared on Phil Chen.