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?

link|improve this question

50% accept rate
feedback

1 Answer

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.

link|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 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 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 at 16:46
hey thanks a lot. That worked. – lovesh Feb 5 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 at 16:54
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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