How to install and enable IMAP PHP Extension in Webmin?

Dear Virtualmin team,

Ubuntu 22.04
Webmin 2.021
Virtualmin 7.7

My new application requires IMAP PHP Extension enabled in the system. I spent quite lot of time by searching by Forum and Internet, still cannot find the right way to install IMAP PHP Extension in Virtualmin environment. As I do not want to install some mess library package on this fresh Virtualmin hosting system, I want to seek for help from your team in this matter.

I help tried these command, and seems php imap has not been enabled at this moment.

php -m | grep imap
** nothing shown in next line

apt-cache search php8.1-imap
php8.1-imap - IMAP module for PHP ← shown

php -r “print_r(get_loaded_extensions());”
** cannot fnd imap or Imap in the result set
[0] => Core
[1] => date
[2] => libxml

Thanks you very much in advance!
Richard

you did do

sudo apt install php8.1-imap

This installed it ok for me

Why? IMAP works well in Virtualmin (I don’t think it needs it or even PHP) at least users here seem to be able to use IMAP with PHP disabled.

Thank jimr1,

It is also ok for me with your script “sudo apt install php8.1-imap”.

Regards
Richard

You have this the wrong way around php imap requires a mail stack … it’s just a library to manipulate imap functions from within a php script without having to loads of exec’s to the OS in order to get the data required

1 Like

So not needed for Virtualmin - but needed for some optional PHP that has been added to the system like (for example WordPress or similar)

Thats it … i use the lib quite a bit

1 Like

In such cases (some other 3rd party app like WordPress etc) that requires some other external package to be available surely it is the responsibility of that 3rd party app to make it clear during install (or at least in its documentation) that it requires a certain package or at least tries to install it.

Not down to Virtualmin where it just is not required. But yet again down to the choice of some external pile of :poop:

Thats why some people use scripts to deploy and install the php script just as vmin does, I must admit a lot of php coders just seem to list the dependants in their docs and leave it up to the end user to install them all the stuff I code comes with an installer that handles the dependants or if it’s some real basic script I just hope php has been installed correctly

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.