If your PHP site/var/log/httpd/error_log the following error:
PHP Fatal error:call to undefined function mcrypt_get_block_size () In/var/www/html/miniblog/system/classes/class_ des.php on line 40
Heart presumably is MCrypt not installed
The installation steps are as follows:
1. View current PHP version #php-version
2. If the current Linux PHP has the best source code package, if there is no source code package, need to download a original code package, upload to the server decompression
3. Confirm that Libmcrypt is installed
Ldconfig-p | grep libmcrypt
If not installed:
Download Address: Http://sourceforge.net/projects/mcrypt
Can download both Libmcrypt and MCrypt
Install Libmcrypt First, default installation directory for/usr/local, PHP manual recommendation? Disable-posix-threads, somehow
./configure && make && make install
Ldconfig
Install MCrypt again, the default installation directory is/usr/local
./configure? with-libmcrypt-prefix=/usr/local
4. Confirm that Mhash is installed
Ldconfig-p | grep Mhash
If not installed:
Download Address: http://mhash.sourceforge.net/
./configure && make && make install
Ldconfig
5. Enter the source directory, install the MCrypt module, this step will generate a mcrypt.so file
CD Php-x.x.x/ext/mcrypt
./configure with-mcrypt=/usr/local/&& make && make install
6. Add one line at the back of the/etc/php.ini: extension=/usr/lib/php/modules/mcrypt.so
7. Restart PHP #service httpd restart
Install the MCrypt module for PHP under Linux
When you get to work, you receive the research and development site "call to undefined function Mcrypt_create_iv ()"
Online check is not installed MCrypt module.
Search, most of the online methods are installed MCrypt module to recompile PHP, but my system is running online, not easy to compile.
Here's my process:
Environment: Rhel 5 +php5.3, yum
#yum-y install libmcrypt libmcrypt-devel php-mcrypt php-mbstring
Find related files
#updatedb
#locate mcrypt.so
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
#locate Libmcrypt
/usr/local/bin/libmcrypt-config
/usr/local/lib/libmcrypt
/usr/local/lib/libmcrypt.la
/usr/local/lib/libmcrypt.so
/usr/local/lib/libmcrypt.so.4
/usr/local/lib/libmcrypt.so.4.4.8
With these two data, we can add MCrypt modules on the php.ini.
#locate php.ini
/usr/local/php5/lib/php.ini
#vi/usr/local/php5/lib/php.ini
Add two lines
Extension=mcrypt.so
; Default:compiled in Into Libmcrypt (Usually/usr/local/lib/libmcrypt)
; mcrypt.modes_dir=
mcrypt.modes_dir=/usr/local/lib/
: Wq Save Exit
To restart Apache