Error message: mcrypt Extensions cannot be loaded. (1) extension = php_mcrypt.dll is changed to extension = php_mcrypt.dll // remove the previous one to make it take effect. [root @ www.bkjia.com ~] # Updatedb # update a database
[Root @ www.bkjia.com ~] # Locate php. ini # search for files
/Usr/local/php. ini
/Usr/local/php. ini. default
/Usr/src/php-5.2.16/php. ini-dist
/Usr/src/php-5.2.16/php. ini-recommended
/Usr/src/php-5.3.4/php. ini-development
/Usr/src/php-5.3.4/php. ini-production
[Root @ www.bkjia.com ~] # Vi/usr/local/php. ini. default # view the backup file and find the field
; Extension = php_mcrypt.dll
Copy to the php. ini file and start this function.
Default_socket_timeout = 60
Extension = php_mcrypt.dll
[Date]
The problem persists.
View apache error logs
[Root @ www.bkjia.com ~] # Grep mcrypt/usr/local/apache/logs/error_log
PHP Warning: PHP Startup: Unable to load dynamic library './php_mcrypt.dll'-./php_mcrypt.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Download and install the libmcrypt component
[Root @ www.bkjia.com ftpuser1] # cd/usr/src/
[Root @ www.bkjia.com src] # ls lib *
Libmcrypt-2.5.7.tar.gz
[Root @ www.bkjia.com src] # tar-xzvf libmcrypt-2.5.7.tar.gz
[Root @ www.bkjia.com libmcrypt-2.5.7] # mkdir/usr/local/libmcrypt
[Root @ www.bkjia.com libmcrypt-2.5.7] #./configure -- prefix =/usr/local/libmcrypt/
[Root @ www.bkjia.com libmcrypt-2.5.7] # make & make install
Recompile php
[Root @ www.bkjia.com php-5.2.16] #. /configure -- prefix =/usr/local/php -- enable-mbstring -- with-config-file-path =/usr/local/php -- with-apxs2 =/usr/local/apache/ bin/apxs -- with-mysql =/usr/local/mysql -- with-mcrypt =/usr/local/libmcrypt/
[Root @ www.bkjia.com php-5.2.16] # ls php *
Php5.spec php5.spec. in php.gif php. ini-dist php. ini-recommended
[Root @ www.bkjia.com php-5.2.16] # cp php. ini-recommended/usr/local/php. ini # create a php configuration file
Extension = php_mcrypt.dll
[Root @ www.bkjia.com php] # cp php. ini php. ini. bak # back up the configuration document
[Root @ www.bkjia.com php] # rm-rf php. ini
[Root @ www.bkjia.com php] # grep-v '; 'php. ini. bak> php. ini # Delete the old configuration document and create a new configuration document
[Root @ www.bkjia.com php] #
Restart apache to solve the problem.