[PHP] Hướng dẫn cài đặt PHP 7.3 trên Centos 7

Bản phát hành PHP 7.3 có nhiều bản sửa lỗi, bao gồm lỗ memory segmentation/corruption faults

Bước 1: Add PHP 7.3 Remi repository

sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install epel-release yum-utils

Bước 2: Disable repo PHP 5.4

sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php73

Step 3: Install PHP 7.3 on CentOS 7

sudo yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

Check version php vừa cài đặt

php -v
PHP 7.3.1 (cli) (built: Jan  8 2019 13:55:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies

Bước 4: Cài đặt các PHP 7.3 Extensions khác

Install PHP 7.3 extensions by using the syntax

sudo yum install php-<entension-name>

Ví dụ, cài đặt php mysql module

sudo yum install php-mysql

Nó chỉ hoạt động nếu repository PHP packages là 7.3

sudo yum install php-mysqlnd

Kiểm tra extension

rpm -qi php-mysqlnd
Name        : php-mysqlnd
Version     : 7.3.1
Release     : 1.el7.remi
Architecture: x86_64
Install Date: Thu 10 Jan 2019 06:56:47 PM UTC
Group       : Development/Languages
Size        : 856852
License     : PHP
Signature   : DSA/SHA1, Tue 08 Jan 2019 06:44:21 PM UTC, Key ID 004e6f4700f97f56
Source RPM  : php-7.3.1-1.el7.remi.src.rpm
Build Date  : Tue 08 Jan 2019 06:24:34 PM UTC
Build Host  : builder.remirepo.net
Relocations : (not relocatable)
Packager    : https://blog.remirepo.net/
Vendor      : Remi Collet
URL         : http://www.php.net/
Bug URL     : https://forum.remirepo.net/
Summary     : A module for PHP applications that use MySQL databases
Description :
The php-mysqlnd package contains a dynamic shared object that will add
MySQL database support to PHP. MySQL is an object-relational database
management system. PHP is an HTML-embeddable scripting language. If
you need MySQL support for PHP applications, you will need to install
this package and the php package.
This package use the MySQL Native Driver

Chúc các bạn thành công.

Bình luận