Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a LAMP box running Ubuntu, Apache 2 and PHP5 with Slicehost. I'm a bit new to all this sysadmin stuff (I'm primarily a web developer).

I need to use the IMAP functions in PHP, but they don't seem to be enabled according to phpinfo(). How do I enable them?

All of the information I can find on the net says I need to recompile PHP to add it, but I don't have a clue how to do that.

Any advice would be most appreciated. Thanks.

share|improve this question

2 Answers 2

up vote 11 down vote accepted

Well, that depends on the distribution your LAMP server is running on. For example with Debian you can install the PHP5 IMAP module straight from the package manager with command apt-get install php5-imap.

share|improve this answer
I tried this, but the IMAP functions still don't show up in the php.ini (even after rebooting Apache and the whole server). I played with a LAMP box a few years back with the original PHP and Apache and remember having to open php.ini and uncomment a line to activate a module - I can't see any sign of that now though. – Hellweaver666 Aug 23 '10 at 9:47
What extensions are listed in php.ini or other ini files? Is there somewhere a line like If not, just add it. – Janne Pikkarainen Aug 23 '10 at 9:56
I re-performed your original suggestion, rebooted apache and it's now working - I must have cocked something up the first time. Thanks! – Hellweaver666 Aug 23 '10 at 10:28
It's not enough to install it. You have to enable it as @JohnSimmonds mentionned. – ychaouche Sep 3 at 9:25

Carry out the following:

apt-get install php5-imap

However it's not enabled by default so enable it with:

php5enmod imap

Then bounce apache:

service apache2 restart


share|improve this answer
Yes, after enabling php module its working like a charm – Sabbir Mar 25 at 5:31

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.