The imap extension of PHP helps to operate with the IMAP protocol, as well as the NNTP, POP3 and local mailbox access methods. In this post, we will learn how to enable php5-imap on Ubuntu 14.04 LTS Server. The php5-imap extension basically used in mail with IMAP protocol.
Install php5-imap on Ubuntu
Use the below given command to install php5-imap extension
sudo apt-get install php5-imap
Enable php5-imap on Ubuntu
Now enable php5-imap
sudo php5enmod imap
Restart the Apache service
In Ubuntu, use the below given command to restart the Apache service
sudo service apache2 restart
Verify IMAP module is loaded
1. With command line inside server, use the below given command .
php -m|grep imap
EXAMPLE:
root@ubuntu:~# php -m|grep imap imap root@ubuntu:~#
2. Or you can use phpinfo() function in a file and place it in web data directory.
Create a file called in web directory called info.php
vi info.php
Paste below given code in info.php
Now open the web browser and give path upto info.php . For example, I have placed info.php file in root web directory of sharadchhetri.com , hence I will use URL https://sharadchhetri.com/info.php
Just look for IMAP in web browser.It should be look like this.