【发布时间】:2019-07-11 09:35:29
【问题描述】:
我正在为我们的网络服务器使用 Google Cloud Compute Engine。我们使用 Ondřej Surý 的 PPA 在 PHP7.2 上运行我们的网络应用程序。
我们有一个启动脚本来安装所有必需的包并进行配置:
apt install -y apache2 php7.2 php7.2-common php7.2-cli php7.2-mysql php7.2-json php7.2-opcache php7.2-readline php7.2-intl php7.2-mbstring php7.2-zip php7.2-curl php7.2-xml php7.2-memcached php7.2-imagick php7.2-bcmath php7.2-json
a2dismod php7.0
a2enmod php7.2
update-alternatives --set php /usr/bin/php7.2
update-alternatives --set phar /usr/bin/phar7.2
update-alternatives --set phar.phar /usr/bin/phar.phar7.2
update-alternatives --set phpize /usr/bin/phpize7.2
update-alternatives --set php-config /usr/bin/php-config7.2
在虚拟机的初始设置中,一切正常,所有包都安装成功。
但是当我们需要安装新的 php7.2-XXX 软件包或更新已安装的软件包时,我们总是会遇到如下配置错误:
所以当我们运行apt -y upgrade 时,我们最终会得到这些错误:
Setting up php7.2-common (7.2.20-1+ubuntu16.04.1+deb.sury.org+1) ...
Internal error!
dpkg: error processing package php7.2-common (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php7.2-curl:
php7.2-curl depends on php7.2-common (= 7.2.20-1+ubuntu16.04.1+deb.sury.org+1); however:
Package php7.2-common is not configured yet.
dpkg: error processing package php7.2-json (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.2-opcache:
php7.2-opcache depends on php7.2-common (= 7.2.20-1+ubuntu16.04.1+deb.sury.org+1); however:
Package php7.2-common is not configured yet.
...
结束于:
Errors were encountered while processing:
php7.2-common
php7.2-json
php7.2-opcache
php7.2-readline
php7.2-cli
libapache2-mod-php7.2
php7.2
php7.2-bcmath
php7.2-curl
php7.2-gd
php7.2-intl
php7.2-mbstring
php7.2-mysql
php7.2-soap
php7.2-xml
php7.2-zip
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试了什么:
rebooting
apt autoremove
apt autoclean
apt clean
re-running our startup script
dpkg --configure php7.2-common 导致:
Setting up php7.2-common (7.2.20-1+ubuntu16.04.1+deb.sury.org+1) ...
Internal error!
dpkg: error processing package php7.2-common (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
php7.2-common
幸运的是,我们的网络应用似乎运行良好。 数周以来一直在四处寻找有关这些错误的更多信息。
【问题讨论】:
-
请提供以下输出:dpkg --configure -a
-
@gries pastebin.com/raw/v8YG6LQE
-
在 apt -y upgrade 之前尝试运行 apt-get autoremove 和 apt-get update
-
抱歉,我已经尝试过了,更新了我的问题。
-
你试过了吗:dpkg --configure php7.2-common ?
标签: php apache2 ubuntu-16.04 google-compute-engine