Ubuntu 系統升級到php7.2/7.3 (平滑升級)-朝花夕拾

系統內核:php

Linux darrykinger-virtual-machine 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

 系統分發版本:nginx

darrykinger@darrykinger-virtual-machine:~/php-rabbitmq$ cat /etc/issue
Ubuntu 14.04.5 LTS \n \l

  系統默認的是php5.2的版本ubuntu

      平滑升級步驟:bash

         1. 添加軟件源的擴展工具php7

    

sudo apt-get  install software-properties-common apt-transport-https lsb-release ca-certificates

     2. 增長php的PPA源:php-fpm

add-apt-repository ppa:ondrej/php  

    3. 2中帶OK字樣,說明OK,若是不放心,能夠直接echo $?工具

          4.更新apt源ui

 

sudo apt-get update

   5.  安裝Php7.x相關的軟件包:命令行

darrykinger@darrykinger-virtual-machine:~/php-rabbitmq$ sudo apt-get install php7.3-fpm 

  6.安裝php7.x的命令行模式:blog

sudo apt-get install php7.3-cli 

  命令行的驗證模式:

darrykinger@darrykinger-virtual-machine:~/php-rabbitmq$ php -v
PHP 7.3.4-1+ubuntu14.04.1+deb.sury.org+3 (cli) (built: Apr 10 2019 11:32:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.4-1+ubuntu14.04.1+deb.sury.org+3, Copyright (c) 1999-2018, by Zend Technologies

  php腳本的驗證模式:

          配合安裝nginx ,進行php-fpm解析php腳本,

       能夠隨意寫一個php腳本,好比:index.php ,內容以下:

<?php 
      phpinfo();

  打印出來的信息以下:

至此,PHP的升級完成;

相關文章
相關標籤/搜索