2

我们有一个 NGINX 服务器在 Ubuntu 14.04.2 LTS 上运行,带有 php5-fpm。

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

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

如何启用 PHP IMAP?

我检查了我们的phpinfo,似乎 IMAP 以某种方式存在,您可以在此处查看我们的 phpinfo的屏幕截图。

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.inimods-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
4

1 回答 1

0

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

以下是您需要运行命令的顺序

sudo apt-get install php5-imap

sudo php5enmod imap 

service php5-fpm restart

sudo service nginx restart
于 2016-11-23T18:03:31.973 回答