Could I use php7-imap ?

I have php7 and php7-imap installed under openSUSE Tumbleweed. I try to read e-mails from my inbox by:

imap_open($hostname,$username,$password);

There appears an:

Fatal error: Uncaught Error: Call to undefined function imap_open() in …

Is there any way to read my e-mails using php7-imap or another way ?
( I am not experienced, I am doing above to learn PHP )

Are php7 and php7-imap enabled in the webserver?


sudo a2enmod -l

~> sudo a2enmod -l
[sudo] password for root: 
actions alias auth_basic authn_core authn_file authz_host authz_groupfile authz_core authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir reqtimeout version php7

I just installed php7 and php7-imap, nothing more … don’t know how to enable them in the webserver. I afraid I have not any web server at my home computer. I think I try to use internal php-server.

Try


a2enmod imap
systemctl restart apache2.service

~> a2enmod imap
Absolute path to 'a2enmod' is '/usr/sbin/a2enmod', so running it may require superuser privileges (eg. root).
:~> sudo a2enmod imap
[sudo] password for root: 
:~> systemctl restart apache2.service
:~>

I found that the reason is:

> php -S 192.168.0.8:8000
[Fri Mar  8 00:43:42 2019] PHP Warning:  PHP Startup: Unable to load dynamic library 'imap.so' (tried: /usr/lib64/php7/extensions/imap.so (libc-client.so.2007e_suse: cannot open shared object file: No such file or directory), /usr/lib64/php7/extensions/imap.so.so (/usr/lib64/php7/extensions/imap.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.2 Development Server started at Fri Mar  8 00:43:42 2019
Listening on http://192.168.0.8:8000

There is installed:

php7-imap PHP7 Extension Module 7.0.5-4.122 123.4 Kib