3. Reinstall Mhash
#tar-zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./configure
#make
#make install
4. Finally install MCrypt
#tar-zxvf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#LD_LIBRARY_PATH =/usr/ Local/lib./configure
#make
#make Install
Description: Because the Libmcrypt link library cannot be found when the MCrypt is configured, it cannot be compiled because the Libmcrypt link library is in/usr The/local/lib folder.
Because of times, to join the Ld_library_path=/usr/local/lib Import key library when configuring MCrypt.
three. Install php pecl extension mcrypt
Note MCrypt is the pecl extension of PHP, so just go to the zip directory of PHP to find MCrypt package.
1. Dynamic loading
The common problem with PHP is that you forget to add an extension when you compile PHP, and then you want to add an extension, but because you install PHP and then put some things like pear, do not want to reload the entire PHP, So you can use dynamic compilation, using Phpize. Note that you need to have exactly the same PHP compression package as the existing PHP.
#cd/usr/php-5.4.8/ext/mcrypt
#/usr/local/webserver/php/bin/phpize
#./configure--with-php-config=/usr /local/webserver/php/bin/php-config
#make && make install
adds an ex to your php.initension=mcrypt.so
Restart Apache
#/usr/local/apache2/bin/apachectl Restart
View phpinfo (), MCrypt and installation of
Installation complete
--------------------------
2. Static compilation
add functions to any PHP file Phpinfo (), You can get the current configuration of PHP
Add the configuration to add after these configurations:--with-mcrypt--with-mhash
and then enter the PHP source directory made clean (necessary), and then execute this complete configure command , and then
Make
make install
Add the configuration you want, for example:
./configure--with-apxs2=/usr/local/web /apache/bin/apxs--with-mcrypt--with-mhash
//./configure--with-apxs2=/usr/local/web/apache/bin/apxs-- With-mcrypt--with-mhash--with-libxml-dir--enable-bcmath--enable-sockets