php 安装显示 dpkg 错误

php 安装显示 dpkg 错误

使用命令安装 php 时

sudo apt install php libapache2-mod-php php-mysql

终端显示:

genius@genius:~$ sudo apt install php libapache2-mod-php php-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php7.2 php7.2 php7.2-cli php7.2-common php7.2-json
  php7.2-mysql php7.2-opcache php7.2-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  libapache2-mod-php libapache2-mod-php7.2 php php-mysql php7.2 php7.2-cli
  php7.2-common php7.2-json php7.2-mysql php7.2-opcache php7.2-readline
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,963 kB of archives.
After this operation, 17.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-common amd64 7.2.10-0ubuntu0.18.04.1 [878 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-json amd64 7.2.10-0ubuntu0.18.04.1 [18.8 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-opcache amd64 7.2.10-0ubuntu0.18.04.1 [165 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-readline amd64 7.2.10-0ubuntu0.18.04.1 [12.1 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-cli amd64 7.2.10-0ubuntu0.18.04.1 [1,405 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libapache2-mod-php7.2 amd64 7.2.10-0ubuntu0.18.04.1 [1,349 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 libapache2-mod-php all 1:7.2+60ubuntu1 [3,212 B]
Get:8 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2 all 7.2.10-0ubuntu0.18.04.1 [9,248 B]
Get:9 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 php all 1:7.2+60ubuntu1 [3,084 B]
Get:10 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 php7.2-mysql amd64 7.2.10-0ubuntu0.18.04.1 [118 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 php-mysql all 1:7.2+60ubuntu1 [2,004 B]
Fetched 3,963 kB in 6s (623 kB/s)                                              
Selecting previously unselected package php7.2-common.
(Reading database ... 257900 files and directories currently installed.)
Preparing to unpack .../00-php7.2-common_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-common (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-json.
Preparing to unpack .../01-php7.2-json_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-json (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-opcache.
Preparing to unpack .../02-php7.2-opcache_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-opcache (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-readline.
Preparing to unpack .../03-php7.2-readline_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-readline (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php7.2-cli.
Preparing to unpack .../04-php7.2-cli_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-cli (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package libapache2-mod-php7.2.
Preparing to unpack .../05-libapache2-mod-php7.2_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libapache2-mod-php7.2 (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package libapache2-mod-php.
Preparing to unpack .../06-libapache2-mod-php_1%3a7.2+60ubuntu1_all.deb ...
Unpacking libapache2-mod-php (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2.
Preparing to unpack .../07-php7.2_7.2.10-0ubuntu0.18.04.1_all.deb ...
Unpacking php7.2 (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php.
Preparing to unpack .../08-php_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php (1:7.2+60ubuntu1) ...
Selecting previously unselected package php7.2-mysql.
Preparing to unpack .../09-php7.2-mysql_7.2.10-0ubuntu0.18.04.1_amd64.deb ...
Unpacking php7.2-mysql (7.2.10-0ubuntu0.18.04.1) ...
Selecting previously unselected package php-mysql.
Preparing to unpack .../10-php-mysql_1%3a7.2+60ubuntu1_all.deb ...
Unpacking php-mysql (1:7.2+60ubuntu1) ...
Setting up php7.2-common (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/calendar.ini with new version

Creating config file /etc/php/7.2/mods-available/ctype.ini with new version

Creating config file /etc/php/7.2/mods-available/exif.ini with new version

Creating config file /etc/php/7.2/mods-available/fileinfo.ini with new version

Creating config file /etc/php/7.2/mods-available/ftp.ini with new version

Creating config file /etc/php/7.2/mods-available/gettext.ini with new version

Creating config file /etc/php/7.2/mods-available/iconv.ini with new version

Creating config file /etc/php/7.2/mods-available/pdo.ini with new version

Creating config file /etc/php/7.2/mods-available/phar.ini with new version

Creating config file /etc/php/7.2/mods-available/posix.ini with new version

Creating config file /etc/php/7.2/mods-available/shmop.ini with new version

Creating config file /etc/php/7.2/mods-available/sockets.ini with new version

Creating config file /etc/php/7.2/mods-available/sysvmsg.ini with new version

Creating config file /etc/php/7.2/mods-available/sysvsem.ini with new version

Creating config file /etc/php/7.2/mods-available/sysvshm.ini with new version

Creating config file /etc/php/7.2/mods-available/tokenizer.ini with new version
Setting up php7.2-readline (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/readline.ini with new version
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up php7.2-json (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/json.ini with new version
Setting up php7.2-opcache (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/opcache.ini with new version
Setting up php7.2-mysql (7.2.10-0ubuntu0.18.04.1) ...

Creating config file /etc/php/7.2/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/7.2/mods-available/mysqli.ini with new version

Creating config file /etc/php/7.2/mods-available/pdo_mysql.ini with new version
Setting up php7.2-cli (7.2.10-0ubuntu0.18.04.1) ...
update-alternatives: using /usr/bin/php7.2 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.2 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.2 to provide /usr/bin/phar.phar (phar.phar) in auto mode

Creating config file /etc/php/7.2/cli/php.ini with new version
Setting up libapache2-mod-php7.2 (7.2.10-0ubuntu0.18.04.1) ...
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
dpkg: error processing package libapache2-mod-php7.2 (--configure):
 installed libapache2-mod-php7.2 package post-installation script subprocess returned error exit status 1
Setting up php-mysql (1:7.2+60ubuntu1) ...
dpkg: dependency problems prevent configuration of libapache2-mod-php:
 libapache2-mod-php depends on libapache2-mod-php7.2; however:
  Package libapache2-mod-php7.2 is not configured yet.

dpkg: error processing package libapache2-mod-php (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.2:
 php7.2 depends on libapache2-mod-php7.2 | php7.2-fpm | php7.2-cgi; however:
  Package libapache2-mod-php7.2 is not configured yet.
  Package php7.2-fpm is not installed.
  Package php7.2-cgi is not installed.

dpkg: error processing package php7.2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php:
 php depends on php7.2; however:
  Package php7.2 is not configured yet.

dpkg: error processing package php (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    No apport report written because MaxReports is reached already
                                  Errors were encountered while processing:
 libapache2-mod-php7.2
 libapache2-mod-php
 php7.2
 php
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试重新安装,但输出相同。请帮助我修复此问题并正确安装 php。

相关内容