我已经尝试重新安装 PHP5.6 十几次了
sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
似乎没什么帮助。尝试安装 PHP7 - 没有成功。
我收到的错误
$ apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up php5.6-cli (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Error: The new file /usr/lib/php/5.6/php.ini-production.cli does not exist!
dpkg: error processing package php5.6-cli (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5.6-fpm:
php5.6-fpm depends on php5.6-cli; however:
Package php5.6-cli is not configured yet.
dpkg: error processing package php5.6-fpm (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5.6:
php5.6 depends on php5.6-fpm | libapache2-mod-php5.6 | php5.6-cgi; however:
Package php5.6-fpm is not configured yet.
Package libapache2-mod-php5.6 is not installed.
Package php5.6-cgi is not installed.
dpkg: error processing package php5.6 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5.6-json:
php5.6-json depends on phpapi-20131226; however:
Package phpapi-20131226 is not installed.
Package php5.6-fpm which provides phpapi-20131226 is not configured yet.
Package php5.6-cli which provides phpapi-20131226 is not configured yet.
dpkg: error processing package php5.6-json (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
php5.6-cli
php5.6-fpm
php5.6
php5.6-json
E: Sub-process /usr/bin/dpkg returned an error code (1)
擦除 PHP 后,尝试安装全新的 PHP 5.6:
$ apt-get install php5.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
php-common php5.6-cli php5.6-common php5.6-fpm php5.6-json php5.6-opcache
php5.6-readline
Suggested packages:
php-pear
The following NEW packages will be installed:
php-common php5.6 php5.6-cli php5.6-common php5.6-fpm php5.6-json
php5.6-opcache php5.6-readline
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3,318 kB of archives.
After this operation, 13.8 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package php-common.
(Reading database ... 38500 files and directories currently installed.)
Preparing to unpack .../php-common_1%3a36+deb.sury.org~trusty+1_all.deb ...
Unpacking php-common (1:36+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6-common.
Preparing to unpack .../php5.6-common_5.6.20+dfsg-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5.6-common (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6-opcache.
Preparing to unpack .../php5.6-opcache_5.6.20+dfsg-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5.6-opcache (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6-readline.
Preparing to unpack .../php5.6-readline_5.6.20+dfsg-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5.6-readline (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6-cli.
Preparing to unpack .../php5.6-cli_5.6.20+dfsg-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5.6-cli (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6-json.
Preparing to unpack .../php5.6-json_1.3.9-2+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5.6-json (1.3.9-2+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6-fpm.
Preparing to unpack .../php5.6-fpm_5.6.20+dfsg-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5.6-fpm (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5.6.
Preparing to unpack .../php5.6_5.6.20+dfsg-1+deb.sury.org~trusty+1_all.deb ...
Unpacking php5.6 (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up php-common (1:36+deb.sury.org~trusty+1) ...
Setting up php5.6-common (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Creating config file /etc/php/5.6/mods-available/calendar.ini with new version
Creating config file /etc/php/5.6/mods-available/ctype.ini with new version
Creating config file /etc/php/5.6/mods-available/exif.ini with new version
Creating config file /etc/php/5.6/mods-available/fileinfo.ini with new version
Creating config file /etc/php/5.6/mods-available/ftp.ini with new version
Creating config file /etc/php/5.6/mods-available/gettext.ini with new version
Creating config file /etc/php/5.6/mods-available/iconv.ini with new version
Creating config file /etc/php/5.6/mods-available/pdo.ini with new version
Creating config file /etc/php/5.6/mods-available/phar.ini with new version
Creating config file /etc/php/5.6/mods-available/posix.ini with new version
Creating config file /etc/php/5.6/mods-available/shmop.ini with new version
Creating config file /etc/php/5.6/mods-available/sockets.ini with new version
Creating config file /etc/php/5.6/mods-available/sysvmsg.ini with new version
Creating config file /etc/php/5.6/mods-available/sysvsem.ini with new version
Creating config file /etc/php/5.6/mods-available/sysvshm.ini with new version
Creating config file /etc/php/5.6/mods-available/tokenizer.ini with new version
Setting up php5.6-opcache (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Creating config file /etc/php/5.6/mods-available/opcache.ini with new version
Setting up php5.6-readline (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
Creating config file /etc/php/5.6/mods-available/readline.ini with new version
Setting up php5.6-cli (5.6.20+dfsg-1+deb.sury.org~trusty+1) ...
update-alternatives: using /usr/bin/php5.6 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar5.6 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar5.6 to provide /usr/bin/phar.phar (phar.phar) in auto mode
Error: The new file /usr/lib/php/5.6/php.ini-production.cli does not exist!
dpkg: error processing package php5.6-cli (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5.6-fpm:
php5.6-fpm depends on php5.6-cli; however:
Package php5.6-cli is not configured yet.
dpkg: error processing package php5.6-fpm (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5.6:
php5.6 depends on php5.6-fpm | libapache2-mod-php5.6 | php5.6-cgi; however:
Package php5.6-fpm is not configured yet.
Package libapache2-mod-php5.6 is not installed.
Package php5.6-cgi is not installed.
dpkg: error processing package php5.6 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5.6-json:
php5.6-json depends on phpapi-20131226; however:
Package phpapi-20131226 is not installed.
Package php5.6-fpm which provides phpapi-20131226 is not configured yet.
Package php5.6-cli which provides phpapi-20131226 is not configured yet.
dpkg: error processing package php5.6-json (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
php5.6-cli
php5.6-fpm
php5.6
php5.6-json
E: Sub-process /usr/bin/dpkg returned an error code (1)
系统信息:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
You have new mail.
编辑:
看起来这是一个存储库问题。12 小时后,我执行了 apt-get update 和 apt-get upgrade - 现在一切正常。