Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function Webklex\IMAP\imap_open() - Mac OS #279

Closed
FounderCasey opened this issue Jan 24, 2020 · 8 comments
Closed

Call to undefined function Webklex\IMAP\imap_open() - Mac OS #279

FounderCasey opened this issue Jan 24, 2020 · 8 comments

Comments

@FounderCasey
Copy link

Hello,

I have a Laravel 6 and PHP 7.4.1 project looking to incorporate Laravel IMAP.

I had some trouble installing the package, but finally got composer to install it. Now I am getting this error when trying to connect.

Call to undefined function Webklex\IMAP\imap_open()

I have read that this could be an issue with PHP not finding my IMAP extension.

When I run php -i | grep imap

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

Full return:
Additional .ini files parsed => /usr/local/etc/php/7.4/conf.d/ext-imap.ini, Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp imap imap.enable_insecure_rsh => Off => Off

Any pointers?

@FounderCasey
Copy link
Author

@Webklex Sorry, not sure I understand the reference... New to php and I am unable to find any info. Is there something I should change?

@Webklex
Copy link
Owner

Webklex commented Jan 25, 2020

Hi @FounderCasey ,
please give the current master version a try :)

@FounderCasey
Copy link
Author

@Webklex I went ahead and tried that but the error just changed to

Call to undefined function imap_open() instead of Call to undefined function Webklex\IMAP\imap_open()

@Webklex
Copy link
Owner

Webklex commented Jan 25, 2020

Please check the output of php_info(). The php-imap module might not be enabled on your Webserver? Yes I know your cli does say its installed but your apache or nginx has its own config (php.ini).

@FounderCasey
Copy link
Author

FounderCasey commented Jan 25, 2020

`user "MYUSER" staff;
worker_processes auto;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout  65;
types_hash_max_size 2048;
client_max_body_size 128M;

server_names_hash_bucket_size 128;

gzip  on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;

ssi on;

gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component;

include "/Users/MYPATH/.config/valet/Nginx/*";
include servers/*;
include valet/valet.conf;

}
`

This is all I could find in regards to an actual config file for Nginx... This must be my set up.

In phpinfo() - my server-software shows nginx/1.17.7

$_SERVER['SERVER_SOFTWARE'] nginx/1.17.7

@Webklex
Copy link
Owner

Webklex commented Jan 25, 2020

I did some more research.
I've never used nginx but it seems like you have to use php-fpm as an intermediate proxy to use any php module.

sudo apt-get install php5-imap
sudo php5enmod imap 
service php5-fpm restart
sudo service nginx restart

@FounderCasey
Copy link
Author

Still nothing... Well, this sucks. Been a week now and I have yet to find a fix.

Thank you for your responsiveness and effort to help!

@FounderCasey
Copy link
Author

@Webklex I factory reset my workspace and I found out that all the requirements except for php-imap come in brew install php, the latest version(7.4.2). First try, everything works great.

I am not sure where I went wrong, I believe it was because I had different .ini files and I had no clue where they were. Lots of random errors here and there.

Again, thank you for your help and this package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants