Search code examples
phpmacoshomebrewimapmacos-big-sur

Enable imap for PHP 7.4.14 - BIG SUR


i am trying to enable my local development environment, and i have the Apache, PHP and MariaDB already installed in my Big Sur Mac. (all installed with brew) But the imap php extension does not work and that's because the PHP is not loading the extension. The Apache error_log throws:

PHP Warning:  PHP Startup: Unable to load dynamic library 'imap' 
(tried: /usr/local/lib/php/pecl/20190902/imap (dlopen(/usr/local/lib/php/pecl/20190902/imap, 
9): image not found), /usr/local/lib/php/pecl/20190902/imap.so 
(dlopen(/usr/local/lib/php/pecl/20190902/imap.so, 9): image not found)) in Unknown on line 0
[Sun Jan 17 09:30:08.936003 2021] [mpm_prefork:notice] [pid 2187] AH00163: Apache/2.4.46 
(Unix) PHP/7.4.14 configured -- resuming normal operations
[Sun Jan 17 09:30:08.936124 2021] [core:notice] [pid 2187] AH00094: Command line: 
'/usr/local/opt/httpd/bin/httpd -D FOREGROUND'

brew list command throws:

 imap-uw, php@7.4,  ........

Thanks in advance guys
MacOS BigSur 11.1


Solution

  • The extension is right here (with instructions): shivammathur Homebrew Extensions