IT/Install PHP 5.6 on CentOS 7

29 janvier 2020 Rédigé par Linuxine

Par défaut, CentOS est fourni avec une version PHP 5.4, un peu trop vieille pour la plupart des applications type LAMP (la 5.4 date tout de même de 2013).

Après avoir tenté et raté l'installation via le repo webtatic, j'ai découvert que CentOS déconseille officiellement ce repo, et conseille plutôt les repos de Rémi Collet. J'ai donc utilisé son tutoriel, sur son site http://rpms.remirepo.net/wizard/.

Command to install the EPEL repository configuration package:
 # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Command to install the Remi repository configuration package:
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Command to install the yum-utils package (for the yum-config-manager command):

# yum install yum-utils

You want a single version which means replacing base packages from the distribution
Packages have the same name than the base repository, ie php-*
PHP version 5.6 packages are available for CentOS 7 in remi-php56 repository

Command to enable the repository:

# yum-config-manager --enable remi-php56

Command to upgrade (the repository only provides PHP):
# yum update

Command to install additional packages:
# yum install php-xxx

Command to check the installed version and available extensions:
 # php --version
 # php --modules

Écrire un commentaire