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've installed mcrypt on CentOS ( via yum ), but when I try to do a dl() call in A), I get the message in B).

  • A) dl( ) or die('The Mcrypt module could not be loaded ['. $prefix . 'mcrypt.' . PHP_SHLIB_SUFFIX .']');
  • B) The Mcrypt module could not be loaded [ ]

Now, I know that yum has installed mcrypt, but I don't know the location it has put it in. Can I find that out? More importantly, how can I get the latest installed mcrypt working with my PHP system. Many threads suggest you recompile PHP ( ex: ), but I don't know how to do this with CentOS. I've also played with my library paths to no avail. Any help would be greatly appreciated.


  • CentOS: Linux localhost.localdomain 2.6.18-128.1.6.el5 #1 SMP Wed Apr 1 09:10:25 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
  • mcrypt: mcrypt-2.6.8-1.el5.x86_64
  • PHP: php-5.1.6-23.2.el5_3.x86_64


share|improve this question

You need to install the packages libmcrypt and php-mcrypt.

share|improve this answer

Have you checked to make sure that the line


in your php.ini file is not commented out (preceeded with a ;)

share|improve this answer

Yeah I had issues installing the mcrypt module on Centos 5.5 with PHP 5.2.9., what i found is that when I finally found an x64 version of php-mcrypt it installed the file in /usr/lib64/php/modules/ folder, hover my PHP.ini file was looking in a completely different place for it's modules /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ so a copied the mycrpt folder to the /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ folder and added the line extension="" to the top of my php.ini folder saved it and restarted apache and it worked

share|improve this answer

Your Answer


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