The answer is correct.
I added “extension=imap.so” to my php.ini file The error message went away.
However, I have another Centos 7 server running the same setup.
php-imap is installed. I checked phpinfo.php for the loaded php.ini, added the extension and restarted apache2. But I still get the same error message.
Is there some other place I need to check?