Howto make MCrypt and PHP work together on CentOS

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
twashing
Forum Newbie
Posts: 1
Joined: Mon Aug 31, 2009 9:37 am

Howto make MCrypt and PHP work together on CentOS

Post by twashing »

Hi all,

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( mcrypt.so ) or die('The Mcrypt module could not be loaded ['. $prefix . 'mcrypt.' . PHP_SHLIB_SUFFIX .']');
B) The Mcrypt module could not be loaded [ mcrypt.so ]

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: http://forums.theplanet.com/index.php?showtopic=26527 ), 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.

Setup
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


Thanks
Tim
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Howto make MCrypt and PHP work together on CentOS

Post by Darhazer »

Check if dl() is enabled in your php.ini file
Also be informed, that as of PHP 5.2.5, dl() cannot load modules which are outside the extension dir (you are allowed to pass only filename, not path to the function), so editing php.ini might me necessary

Is the PHP installed by yum or it's recompiled? Because with yum's installed PHP, I only need to install a module and restart apache to get it working (OS: Fedora Core 9). Anyway, consider my dl() notes above
Post Reply