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 installed php 5.3.8 from source on Ubuntu 10.10 and now i need mcrypt. I also installed mcrypt from source and restarted apache but still i am not able to see it in my php configuration. I understand i would need a in my php extensions directory. I have installed a lot of extensions and like xdebug and apc and dont want to go through the pain of installing them again. Now how can i install mcrypt without re-installing php and passing mcrypt as a parameter to configure?

share|improve this question
up vote 3 down vote accepted

Usually where you extracted the source you can find the source for all the modules as well. In this case, I think under the "ext" directory. So from the source folder:

[php-5.3.10]$ cd ext/mcrypt/
[mcrypt]$ phpize
[mcrypt]$ ./configure --your-options-here
[mcrypt]$ make && make install

Then edit your php.ini and add:

Finally, restart Apache. And I think that should do it for you.

share|improve this answer
but this way i have to do the make and make install steps again. Cant i do it the way we install xdebug. i mean generating the .so file for mcrypt – lovesh Feb 5 '12 at 16:39
If you run it in the directory I specified, "php-X.YY/ext/mcrypt" it will only build the Mcrypt sources, not all of PHP.The make and make install at the end then will only install the file. – Sweet Feb 5 '12 at 16:44
Alternatively, if you don't feel comfortable running "make install", just run "make" and manually copy the .so file to the extensions directory, as shown by "php -i | grep extension_dir" – Sweet Feb 5 '12 at 16:46
hey thanks a lot. That worked. – lovesh Feb 5 '12 at 16:51
i have doing this make and make install and configure for some time but i dont understand the linux build process clearly. can u please forward me to some link which explains the build process clearly? thanks – lovesh Feb 5 '12 at 16:54
cp /usr/bin/php /usr/bin/php_old

Install php from source.

cp /usr/local/bin/php /usr/bin/php

make sure that this entry exists in this file /etc/php.ini

restart apache...

share|improve this answer
I think the point of the question was to not reinstall PHP, though that might not be really possible... – Falcon Momot Apr 29 '14 at 7:29

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.