How to Enable mhash in PHP built from source

By | October 25, 2008

If you have a server that doesn’t come with any panel and all the software was compiled from sources, you have to install the missing packages by yourself, without any scripts, etc. Today we’ll install mhash support for a server that has nothing related with this library.

As we’re dealing with a non-rpm system, we’ll have to install all the software we need from sources. In order to support hash algoritms we need to install libmhash. Just download it, extract with the following command:

tar -xzvf mhash-0.9.9.tar.gz

and go to the extracted directory:

cd mhash-0.9.9

Then you will use the usual combination for linux:

./configure
make
make install

Then you will need to recompile PHP with

–with-mhash

If you don’t know how to recompile PHP,  just search this blog as it contains lots of information on installing and configuring PHP.