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

In CentOS I have a compiled version of PHP but it is missing IMAP module. Is it possible to add that module without re-compiling php?

share|improve this question
add comment

1 Answer 1

Yes, you can just download the source of your current version, untar it, go the the ext/imap directory of the untared source then run:

phpize
./configure
make

You might need to run ./configure with some options specifiying the imap libraries used like:

  --with-imap=DIR       Include IMAP support. DIR is the c-client install prefix
  ...
  --with-imap-ssl=DIR     IMAP: Include SSL support. DIR is the OpenSSL install prefix

After you compiled the module you should located it under ext/imap/modules, it should be named imap.so like ext/imap/modules/imap.so. You need to move this further to the extension_dir directory that you can get by running php -i | grep extension_dir or by createing a php file that will say <?php phpinfo(); ?> and run it from the web interface after which search for extension_dir on the result page.

After you've moved the module file you'll need to add a line in the php.ini file(or create an .ini file in the additional .ini files directory) that will say:

extension=imap.so

After that you'll need to restart your web-server or php-fpm service in case you're using php-fpm.

share|improve this answer
add comment

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.