Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Imap , php 7.4.3 on mac osx catalina

Tags:

php

imap

This is officially driving me nuts! I'm trying to work with a laravel package for imap functions and I've installed everything there but I get a missing class error for imap_open

I know this means the imap module is not installed, or is problematic, at the php level.

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

When I navigate to user/local/lib/php I have a 7.4 folder, in that I have a conf.d folder, pear.conf file, php-fpm.consf file, php-fpm.d folder, and php.ini file

What do I need to do at this point?

like image 500
Geoff_S Avatar asked Mar 08 '20 20:03

Geoff_S


3 Answers

I've upgraded my 7.3 to 7.4 and added imap extension which does not exist in pecl.

So steps are:

1) brew update

2) brew upgrade php

3) sudo rm /usr/local/lib/php/pecl/20190902/imap.so

4) brew tap kabel/php-ext

5) brew install php-imap

6) php -m | grep imap

like image 187
num8er Avatar answered Oct 20 '22 13:10

num8er


It is a time to update the package. We need [email protected] (actually its an alias to php-imap that loads php-8.0.0 source code.

like image 6
Gassan Avatar answered Oct 20 '22 15:10

Gassan


I've tries all of the things. But, nothing works. Finally, I got Shivammathur git brew extensions -

Homebrew tap for PHP extensions - https://github.com/shivammathur/homebrew-extensions

Process to install imap extension for php 7.4 -

Get PHP 7.4 & Extensions:

brew tap shivammathur/php
brew install shivammathur/php/[email protected]
brew link --force --overwrite [email protected]
brew tap shivammathur/extensions

Get Any extension now, like imap

brew install [email protected]

After then, I can perfectly enabled php-imap on my machine. Hope, it will help somebody.

like image 5
Maniruzzaman Akash Avatar answered Oct 20 '22 13:10

Maniruzzaman Akash