3

We have a NGINX server running on Ubuntu 14.04.2 LTS with php5-fpm.

An application (OEMPRO) I'm trying to install on it says:

PHP IMAP extension is disabled. Please enable it.

How can I enable PHP IMAP?

I've checked our phpinfo and it seems that IMAP is there in some way, you can see a screen shot of our phpinfo here.

Although, I couldn't find IMAP in the mods-available/ directory.

# ls /etc/php5/mods-available/
curl.ini  gd.ini  json.ini  mcrypt.ini  mysqli.ini  mysql.ini  opcache.ini  pdo.ini  pdo_mysql.ini  readline.ini  ssh2.ini

Do I need to enable it in /etc/php5/fpm/php.ini?


UPDATE

I tried installing IMAP but it doesn't resolve the issue. OEMPRO still says the IMAP is disabled.

# sudo apt-get install php5-imap
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libassuan0 libgeoip-dev libgpgme11 libtokyocabinet9
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  php5-imap
0 upgraded, 1 newly installed, 0 to remove and 235 not upgraded.
Need to get 31.7 kB of archives.
After this operation, 158 kB of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/universe php5-imap amd64 5.4.6-0ubuntu5 [31.7 kB]
Fetched 31.7 kB in 0s (0 B/s)  
Selecting previously unselected package php5-imap.
(Reading database ... 60704 files and directories currently installed.)
Preparing to unpack .../php5-imap_5.4.6-0ubuntu5_amd64.deb ...
Unpacking php5-imap (5.4.6-0ubuntu5) ...
Setting up php5-imap (5.4.6-0ubuntu5) ...
# service php5-fpm restart
php5-fpm stop/waiting
php5-fpm start/running, process 2840
# sudo service nginx restart
* Restarting nginx nginx  

My phpinfo remains the same but it I can now see imap.ini in mods-available/.

# ls /etc/php5/mods-available/
curl.ini  gd.ini  imap.ini  json.ini  mcrypt.ini  mysqli.ini  mysql.ini  opcache.ini  pdo.ini  pdo_mysql.ini  readline.ini  ssh2.ini
Alex Blex
  • 34,704
  • 7
  • 48
  • 75
Holly
  • 7,462
  • 23
  • 86
  • 140

1 Answers1

1

I tried just installing PHP IMAP from scratch, at first it didn't seem to work but then I discovered I also had to run sudo php5enmod imap.

Below is the order which you need to run the commands

sudo apt-get install php5-imap

sudo php5enmod imap 

service php5-fpm restart

sudo service nginx restart
Holly
  • 7,462
  • 23
  • 86
  • 140