php-fpm 安装不正确

php-fpm 安装不正确

我正在尝试安装php5-mcrypt,但安装时出现以下错误:

$ sudo apt-get install php5-mcrypt

Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5-mcrypt is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up php5-fpm (5.6.11+dfsg-1ubuntu3.1) ...
insserv: script php5-fpm: service php-fpm already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package php5-fpm (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 php5-fpm
E: Sub-process /usr/bin/dpkg returned an error code (1)

我不知道是什么原因造成的。我尝试卸载php5-fpm

sudo apt-get purge php5-fpm

然后再次安装,错误仍然存​​在。

答案1

我安装了 php7-fpm,并且在我的/etc/init.d目录中有一个名为的文件,php7-fpm删除它似乎可以解决问题。

删除后,我能够安装php5-fpm并且不会出现该错误。

相关内容