Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 mcrypt.so 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

2 Answers 2

up vote 2 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:

extension=mcrypt.so

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 mcrypt.so 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

extension=mcrypt.so

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 at 7:29

Your Answer

 
discard

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.