Php – how can i install enable mcrypt without re-installing php

mcryptPHP

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?

Best Answer

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.