平淡人生

静待花开,花开常有香相伴;倾听流水,流水总有乐相陪;有缘清风携舟涉碧水,无缘细雨伴君独自行。

FreeBSD 升级PHP版本

使用到的命令
pkg update 更新下软件库的信息,这样可以知道软件库中个套件的最新版本。
pkg upgrade 是升级你安装的套件
pkg info 显示软件包信息

第一步升级PHP版本

[email protected]:~ # php -v  #查看升级前PHP版本
PHP 7.1.4 (cli) (built: Nov 25 2017 01:17:11) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.4, Copyright (c) 1999-2017, by Zend Technologies

[email protected]:~ # pkg upgrade php71
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
	php71: 7.1.4 -> 7.1.12
	pcre: 8.37_4 -> 8.40_1

The process will require 84 KiB more space.
3 MiB to be downloaded.

Proceed with this action? [y/N]: y   #同意更新
Fetching php71-7.1.12.txz: 100%    2 MiB 103.2kB/s    00:21    
Fetching pcre-8.40_1.txz: 100%    1 MiB 165.7kB/s    00:07    
Checking integrity... done (0 conflicting)
[1/2] Upgrading pcre from 8.37_4 to 8.40_1...
[1/2] Extracting pcre-8.40_1: 100%
[2/2] Upgrading php71 from 7.1.4 to 7.1.12...
You may need to manually remove /usr/local/etc/php-fpm.d/www.conf if it is no longer needed.
[2/2] Extracting php71-7.1.12: 100%
[email protected]:~ # php -v  #查看升级后版本
PHP 7.1.12 (cli) (built: Nov 25 2017 01:17:11) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.4, Copyright (c) 1999-2017, by Zend Technologies

第二步升级下PHP扩展

pkg upgrade -y php71-ctype php71-dom php71-filter php71-hash php71-iconv php71-json php71-mysqli php71-opcache php71-pdo php71-pdo_mysql php71-pdo_sqlite php71-phar php71-posix php71-session php71-simplexml php71-sqlite3 php71-tokenizer php71-xml php71-xmlreader php71-xmlwriter


Categorised as: FreeBSD技术