Install PHP 7.x with Remi Repository

Installation:

    • This guide provides a single version installation which means replacing base packages from the distribution
    • Packages have the same name than the base repository, ie php-*
    • PHP version 7.2 packages are available for CentOS 7 in remi-php72 repository
    • If the priorities plugin is enabled, ensure remi-php72 have higher priority (a lower value) than base and updates
    • 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
    • Command to enable the repository:
          yum-config-manager --enable remi-php72
    • Command to upgrade (the repository only provides PHP):
          yum update
    • Command to check if the repo has the package you required:
          yum list php-xxx
    • Command to install core packages:
             yum install php
    • Command to install additional packages (Note: if additional packages is install directly without core packages, by default yum will install all required packages too. which means you can skip the core packages installation by directly install the additional packages and core packages will be included):
          yum install php-xxx
    • Command to install testing packages:
          yum --enablerepo=remi-php72-test install php-xxx
  • Command to check the installed version and available extensions:
        php --version
        php --module

 

Possible Problems:

PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0

PHP Fatal error:  Directive 'safe_mode_gid' is no longer available in PHP in Unknown on line 0

Above warning and error may occur due to incompatible configurations. Locate php.ini, remark the no longer valid configurations for PHP to work properly.

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*