Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting this error when I run php -v:

PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mcrypt.dll' - /usr/lib64/php/modules/php_mcrypt.dll: cannot open shared object file: No such file or directory in Unknown on line 0

How can I fix this?

share|improve this question
add output "ls /usr/lib64/php/modules/*mcrypt*" – ooshro Feb 27 '11 at 5:39
what do you mean? – EquinoX Feb 27 '11 at 5:45
up vote 4 down vote accepted

Verify whether exists:

file /usr/lib64/php/modules/

Then change the php.ini line:



If it does not exist, install libmcrypt and php-mcrypt:

 rpmbuild -ta libmcrypt-2.5.7.tar.gz
 rpm -ivh /usr/src/redhat/RPMS/i386/libmcrypt-2.5.7-1.i386.rpm /usr/src/redhat/RPMS/i386/libmcrypt-devel-2.5.7-1.i386.rpm
 yum --enablerepo=centosplus install php-mcrypt

I recommending using Ubuntu for easy installation of PHP, the PHP modules, and a web server. The Ubuntu repository includes FAR more packages and you do not need to connect other repositories and compile applications.

share|improve this answer exists and I already add that line in php.ini before, still the error exists – EquinoX Feb 27 '11 at 5:48
delete "extension=php_mcrypt.dll" line from php.ini – ooshro Feb 27 '11 at 5:50
ok, now it gives me a warning: PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 – EquinoX Feb 27 '11 at 5:53
delete duplication "" line – ooshro Feb 27 '11 at 6:04
there is only one – EquinoX Feb 27 '11 at 6:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.