简体   繁体   English

在mac os sierra和MAMP上安装php Imap

[英]Install php Imap on mac os sierra and MAMP

Im trying to edit a web app on my local host and I am getting the following error: Call to undefined function imap_open() 我试图在我的本地主机上编辑一个Web应用程序,我收到以下错误: Call to undefined function imap_open()

I believe this is because I may not have imap installed or activated on my localhost. 我相信这是因为我可能没有在我的localhost上安装或激活imap。 I am currently running Mac OS Sierra and MAMP (not MAMP Pro) 我目前正在运行Mac OS Sierra和MAMP(不是MAMP Pro)

I find some things online for older versions of Mac OS or using Brew but I don't use brew, is this necessary to get imap working on my setup? 我在网上找到了一些适用于旧版Mac OS或使用Brew的东西,但我不使用brew,这是否有必要让imap处理我的设置? Can someone help me so I don't run into these imap issues? 有人可以帮助我,所以我不会遇到这些imap问题吗?

I also had extension=imap.so set in the PHP.ini file, but IMAP still wasn't supported. 我也在PHP.ini文件中设置了extension = imap.so,但仍然不支持IMAP。 I finally found what worked for me and hopefully will for your situation as well. 我终于找到了对我有用的东西,并希望也适合你的情况。

The next thing to make sure of is that extension_dir is correctly set in the same PHP.ini file. 接下来要确保的是,extension_dir在同一个PHP.ini文件中正确设置。 Mine was set to MAMP_extension_dir_MAMP. 我被设置为MAMP_extension_dir_MAMP。 I didn't see where this variable was set. 我没有看到这个变量的设置位置。 I replaced it with "/Applications/MAMP/bin/php/php5.3.29/lib/php/extensions/no-debug-non-zts-20090626/" and now when I look up phpinfo() page I see that IMAP is enabled. 我用“/Applications/MAMP/bin/php/php5.3.29/lib/php/extensions/no-debug-non-zts-20090626/”替换它,现在当我查找phpinfo()页面时,我看到IMAP是启用。

replace php5.3.29 with your php version and no-debug-non-zts-20090626 with whatever folder name you see in the extensions folder. 将php5.3.29替换为您的php版本,将no-debug-non-zts-20090626替换为您在extensions文件夹中看到的任何文件夹名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM