我表演
sudo apt-get upgrade
并期望看到 PHP 版本从 5.6.30 更新到 5.6.37。令我惊讶的是,php 版本没有升级,但其模块升级了。我在 phpinfo 中仍然看到 5.6.30
dpkg --list | grep php
ii php5.6 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage)
ii php5.6-bcmath 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 Bcmath module for PHP
ii php5.6-cli 5.6.30-7+deb.sury.org~trusty+1 amd64 command-line interpreter for the PHP scripting language
ii php5.6-common 5.6.30-7+deb.sury.org~trusty+1 amd64 documentation, examples and common module for PHP
ii php5.6-curl 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 CURL module for PHP
ii php5.6-fpm 5.6.30-7+deb.sury.org~trusty+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php5.6-gd 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 GD module for PHP
ii php5.6-json 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 JSON module for PHP
ii php5.6-mbstring 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 MBSTRING module for PHP
ii php5.6-mysql 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php5.6-opcache 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP
ii php5.6-readline 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 readline module for PHP
ii php5.6-xml 5.6.37-1+ubuntu14.04.1+deb.sury.org+1 amd64 DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii php5.6-zip 5.6.30-7+deb.sury.org~trusty+1 amd64 Zip module for PHP
如何将 php 版本也升级到 5.6.37?
以下是 apt-cache 策略的输出:
sudo apt-cache policy php5.6-cli php5.6-common php5.6-fpm php5.6-zip
php5.6-cli:
Installed: 5.6.30-7+deb.sury.org~trusty+1
Candidate: 5.6.37-1+ubuntu14.04.1+deb.sury.org+1
Version table:
5.6.37-1+ubuntu14.04.1+deb.sury.org+1 0
500 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main amd64 Packages
*** 5.6.30-7+deb.sury.org~trusty+1 0
100 /var/lib/dpkg/status
php5.6-common:
Installed: 5.6.30-7+deb.sury.org~trusty+1
Candidate: 5.6.37-1+ubuntu14.04.1+deb.sury.org+1
Version table:
5.6.37-1+ubuntu14.04.1+deb.sury.org+1 0
500 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main amd64 Packages
*** 5.6.30-7+deb.sury.org~trusty+1 0
100 /var/lib/dpkg/status
php5.6-fpm:
Installed: 5.6.30-7+deb.sury.org~trusty+1
Candidate: 5.6.37-1+ubuntu14.04.1+deb.sury.org+1
Version table:
5.6.37-1+ubuntu14.04.1+deb.sury.org+1 0
500 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main amd64 Packages
*** 5.6.30-7+deb.sury.org~trusty+1 0
100 /var/lib/dpkg/status
php5.6-zip:
Installed: 5.6.30-7+deb.sury.org~trusty+1
Candidate: 5.6.37-1+ubuntu14.04.1+deb.sury.org+1
Version table:
5.6.37-1+ubuntu14.04.1+deb.sury.org+1 0
500 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main amd64 Packages
*** 5.6.30-7+deb.sury.org~trusty+1 0
100 /var/lib/dpkg/status