6

I have Apache server on Mac OS 10.8. I need module IMAP to be enabled in PHP. I followed this instruction http://blog.xeonxai.com/2009/12/03/160/. I have installed imap.so and link it in php.ini file like this

extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/imap.so

But I cannot get IMAP modules when print out phpinfo() as well as imap_open function. What's wrong with my web server ?

Thanks for helping !

3
  • did you restart the server? Commented Feb 28, 2014 at 12:26
  • Yes I restarted server but nothing happened :(
    – Trung Bui
    Commented Mar 3, 2014 at 2:35
  • Do you use an own installation of PHP or the Mac's integrated installation? Commented Apr 5, 2015 at 19:33

1 Answer 1

7

This is what I did to have the IMAP module working:

  1. Install php56 with IMAP enabled using brew: brew install php56 --with-imap
  2. Edit http.conf and replace the line loading PHP (LoadModule php5_module libexec/apache2/libphp5.so) with the newly installed PHP: LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
  3. Restart apache: sudo apachectl restart
2
  • 1
    On EL Capitan I had to do: brew install homebrew/php/php56 --with-imap It will also install all dependencies: Installing dependencies for homebrew/php/php56: libpng, freetype, gettext, icu4c, imap-uw, jpeg, libxml2, unixodbc, readline
    – Rehmat
    Commented Aug 17, 2016 at 12:14
  • 2
    This doesn't work anymore. Now it shows this: Warning: Use [email protected] instead of deprecated homebrew/php/php56 Warning: [email protected]: this formula has no --with-imap option so it will be ignored!
    – soapergem
    Commented Apr 4, 2018 at 16:19

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