Php install module

From vpsget wiki
Jump to: navigation, search

We will show here how to recompile/reinstall module for php. Sure in most cases you can use yum or apt-get. but sometimes you'll face the next:

php -m #OR:
php -i | grep version
PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525

In this case you need to download the exact php source that installed on your system . Use find first , maybe the php source already exists on your system

You can install Mcrypt from the PHP Source as a module

You first need to ensure you have libmcrypt, libmcrypt-devel, and mcrypt installed, then do:

 cd php-5.x.x/ext/mcrypt # in my case it was /usr/src/php-5.4.21/ext/mcrypt
 make && make install

Enable the module by adding: '' to PHP.ini. (you can also add full path to module here)