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

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

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:


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 like ext/imap/modules/ 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:

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

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.