Home Backend Development PHP Tutorial Detailed tutorial on upgrading PHP from 5.6 to 7.2 under Linux

Detailed tutorial on upgrading PHP from 5.6 to 7.2 under Linux

Feb 18, 2019 pm 02:11 PM
php

This article brings you a detailed tutorial on upgrading PHP from 5.6 to 7.2 under Linux. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. helped.

The current PHP version is 5.6. Since the PHP version requirement of the project is 7.2, upgrade it

1. Check the currently installed PHP

View the current PHP version

php -v
Copy after login
Copy after login

View the current PHP-related installation packages

yum list installed | grep php
Copy after login

2. Change the RPM source

#Centos 5.X:
rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
#CentOs 6.x:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

#CentOs 7.X:
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Copy after login

3. Stop related services

Close php-fpm and nginx services

service php-fpm stop
/usr/local/nginx/sbin/nginx -s stop
BashCopy
Copy after login

4. Delete the installed PHP related packages

yum remove php*
BashCopy
Copy after login

5. Install the new version of PHP

php 7.0/7.1/7.2 are represented as 70w/71w/72w respectively

Currently (2018-5-4)

The highest RPM source of CentOs 6.x is only 7.1

CentOs 7.x has 7.2 in the RPM source

yum install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72w-ldap php72w-mcrypt
BashCopy
Copy after login

6. Restart related services

service php-fpm start
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
BashCopy
Copy after login

Check the version again

php -v
Copy after login
Copy after login

The above is the detailed content of Detailed tutorial on upgrading PHP from 5.6 to 7.2 under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

How To Set Up Visual Studio Code (VS Code) for PHP Development

See all articles