3

We have an RHEL5 server that I'm trying to install PHP-Mcrypt on and I'm stuck when I tried to run ./configure for mcrypt source files.

I was using this guide: http://atlantatechpro.com/howtos/howtoslinux/howtosmhashmcrypt

When I try to install (./configure) mcrypt, I get this

checking for libmcrypt - version >= 2.5.0... no

Could not run libmcrypt test program, checking why... The test program compiled, but did not run. This usually means that the run-time linker is not finding LIBMCRYPT or finding the wrong version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point to the installed location Also, make sure you have run ldconfig if that is required on your system

If you have an old version installed, it is best to remove it, although you may also be able to get things to work by modifying LD_LIBRARY_PATH

configure: error: *** libmcrypt was not found

I also made a file at /etc/ld.so.conf.d/libmcrypt.conf with /usr/local/libmcrypt in it and ran /sbin/ldconfig

I might have screwed things up by trying to reinstall libmcrypt without the configure arguments.

Any suggestions on what to do now?

wag2639
  • 2,115
  • 6
  • 24
  • 32

2 Answers2

6

Don't try to compile yourself, you'll just get yourself into trouble that way. (and even if you were compiling yourself, you should compile into RPMs and install those, instead of installing directly to the systems). First, try to find all the files you've installed yourself and remove them (check that they don't belong to a system package with rpm -qf /file.)

EPEL is the third-party source for RHEL packages that's closest to being "official", so I suggest that: http://fedoraproject.org/wiki/EPEL/FAQ#howtouse

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install php-mcrypt

(the exact RPM url changes with time as updates happen and is different for different RHEL versions, so check the EPEL FAQ to get the correct link.)

The first step sets you up with EPEL, the second installs PHP Mcrypt and all its dependencies.

freiheit
  • 14,334
  • 1
  • 46
  • 69
  • Thanks, I'll try that tomorrow. Is there an easy way to find out and remove all the files that I already tied to install? – wag2639 Mar 22 '10 at 04:16
  • No, there really isn't any reliable, easy, generic way. Which is a big reason to go with RPM instead of direct compile+install. It sounds like you installed everything into /usr/local, so it shouldn't be too hard... – freiheit Mar 22 '10 at 13:24
  • 1
    `make uninstall` is supported in a lot of Makefiles these days. Otherwise, you just remove all the files installed from the output of `make install`. – Warner Mar 22 '10 at 13:59
  • 1
    For people viewing this from Jan 2012 onwards, this URL should (hopefully) work: http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm – hohner Jan 28 '12 at 22:08
  • 1
    @Jamie: The question was about RHEL5, not RHEL6. Just now I updated the example URL and made it clearer that somebody should really check that EPEL FAQ to get the right URL. – freiheit Jan 28 '12 at 22:15
  • @freiheit you're completely right. I just want to make it clear for people who drift onto this thread from Google – hohner Jan 28 '12 at 22:19
  • @Jamie: Feel free to make an edit to the answer itself to make that clearer – freiheit Jan 28 '12 at 23:12
0

http://www.notesbit.com/index.php/web-mysql/web-scripts/how-to-install-mcrypt-in-linux-cent-os-and-recompile-php/

or

install DAG rpm and then

yum install mhash yum install mcrypt yum install php-mhash yum install php-mcrypt

it working for me!!! RHEL 5.4 i'm using

Rajat
  • 3,329
  • 21
  • 29