0

enter image description here

I've edited my php.ini file to have extension=imap and now when I run any php command from the terminal CLI I get

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

I have these in my php.ini

extension_dir=/usr/local/lib/php/pecl/20190902

Additional .ini files parsed=/usr/local/etc/php/7.4/conf.d/ext-opcache.ini, /usr/local/etc/php/7.4/conf.d/imap.ini

Protocols=dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp

IMAP c-Client Version=2007f

SSL Support=enabled

Kerberos Support=enabled

What do I need to do at this point?

Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
Ketan Harsoda
  • 119
  • 1
  • 11
  • does `/usr/local/lib/php/pecl/20190902/imap` exist? – apokryfos Jul 24 '21 at 06:29
  • No. @apokryfos. It does not exist there. – Ketan Harsoda Jul 24 '21 at 06:53
  • https://www.php.net/manual/en/imap.installation.php though if you are using homebrew to install and manage PHP there may be a package you can get from there. Also imap does not seem to be a pecl extension so also check if the commands just work before trying to install it – apokryfos Jul 24 '21 at 07:20
  • @apokryfos I used this one to install imap. https://stackoverflow.com/questions/60591870/php-imap-php-7-4-3-on-mac-osx-catalina – Ketan Harsoda Jul 24 '21 at 08:13
  • 1
    If you install it with homebrew you should not need to modify your php.ini , it should do that for you. Have you actually checked if the extension works before modifying your php.ini but after you installed it using homebrew? – apokryfos Jul 24 '21 at 08:16
  • @apokryfos I can found 20190902 at this path: /usr/local/lib/php/20190902 instead of pecl and there are 2 files are existed in that folder named opcache.a and opcache.so – Ketan Harsoda Jul 24 '21 at 08:16
  • It's not working before I added extension so first I did uncomment imap from php.ini after that I installed imap through homebrew and then did comment of php.ini's extension now error is gone. Thanks! @apokryfos – Ketan Harsoda Jul 24 '21 at 08:20
  • if you have installed it using homebrew, then you should comment imap extension in .ini file – Wasiq Ahmadzai Dec 19 '21 at 05:13

0 Answers0