0

I'm trying to IMAP working on my Mac running Big Sur.

I used HomeBrew to install PHP 8.1:

brew tap shivammathur/php
brew tap shivammathur/extensions
brew install imap@8.1

PHP is working and according to the phpinfo() it's using the correct path. There's also the additional path to the imap.ini The path in the imap.ini exists and there is a imap.so

When i run "php -m" imap is mentioned in the list.

But when I run my code I get the error:

Call to undefined function imap_open()

I tried reinstalling the php with extensions and I tried https://stackoverflow.com/a/66047249/909723 but no success

Hope someone can help

Thanks in advance!

Sephen
  • 1,111
  • 3
  • 16
  • 38
  • 1
    Does this answer your question? [Fatal error: Call to undefined function imap\_open() in PHP](https://stackoverflow.com/questions/9654453/fatal-error-call-to-undefined-function-imap-open-in-php) – Plamen Nikolov Feb 17 '22 at 11:07
  • No, I'm not using XAMP/MAMP – Sephen Feb 17 '22 at 12:04
  • @Peter what are you using to execute PHP requests? – Ian Brindley Feb 17 '22 at 12:20
  • @IanBrindley I don't understand what you're asking but i'm using a local webserver running apache – Sephen Feb 17 '22 at 12:27
  • @Peter Apache :) Have you restarted the Apache? – Ian Brindley Feb 17 '22 at 12:45
  • @IanBrindley Multiple times – Sephen Feb 17 '22 at 12:49
  • @Peter can you verify that your Apache web server is using the same PHP that you have installed with brew? To verify this put `phpinfo();` in your `index.php` or other script and run it through Apache and web browser to verify... It is not uncommon that Apache is using a system installed PHP - as a last step after brew installation of php there are instructions how to configure your Apache to use the brew managed PHP. – Plamen Nikolov Feb 17 '22 at 13:49
  • @PlamenNikolov it's running the only version (8.1.3) of PHP, I even compiled PHP with IMAP and IMAP is still not showing up in the phpinfo(); – Sephen Feb 17 '22 at 14:19
  • @Peter If you are using the system Apache, try using the brew package `httpd`. – Shivam Mathur Feb 20 '22 at 10:54

0 Answers0