如何为php5-fpm / NGINX启用PHP IMAP?

时间:2016-11-23 17:44:24

标签: php nginx fpm php-imap

我们在Ubuntu 14.04.2 LTS上使用php5-fpm运行NGINX服务器。

我正在尝试安装的应用OEMPRO说:

  

禁用PHP IMAP扩展。请启用它。

如何启用PHP IMAP?

我已经检查了phpinfo,似乎IMAP在某种程度上存在,您可以看到我们phpinfo here的屏幕截图。

虽然,我在mods-available/目录中找不到IMAP。

# 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

我是否需要在/etc/php5/fpm/php.ini启用它?

更新

我尝试安装IMAP但它无法解决问题。 OEMPRO仍然表示IMAP已被禁用。

# 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  

我的phpinfo保持不变,但我现在可以在imap.ini中看到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

1 个答案:

答案 0 :(得分:0)

我尝试从头开始安装PHP IMAP,起初它似乎没有用,但后来我发现我还必须运行sudo php5enmod imap

以下是运行命令所需的顺序

sudo apt-get install php5-imap

sudo php5enmod imap 

service php5-fpm restart

sudo service nginx restart