Document toolboxDocument toolbox

(2024.2) PHP 7.2 Upgrade

IMPORTANT: These instructions are only for upgrade installations only. If you are installing a new server, or do not want to run PHP 7.2 alongside an older version please see the PHP 7.2 Install Instructions

Additionally, REDHAT 8 does not auto configure php-fpm as it does in previous versions, so for REDHAT 8, these instructions should be used:

Note to Licensed Customers:

The following information represents the process we use to upgrade hosted installations. 

  • The repos may vary depending the installation.

  • Licensed customers are welcome to use any repos they deem appropriate.

  • All modules listed under "Install the PHP modules required by PCR-360 " are required for PCR-360 to function correctly.

  • The only optional modules are the installation-specific modules listed below the required ones.

  • Zend Guard Loader is not supported in PHP 7.2, is not included in the required modules, and may be safely removed.

  • MCrypt has been deprecated in PHP 7.2, but is still available as an addon module.

  • In PCR-360 version 2019.1, we will be removing the usage of MCrypt in favor of OpenSSL encryption. For version 2018.1, MCrypt is still a required module.

Required PHP Modules

Name

Description

php72-php-process

Dynamic shared objects which add support to PHP using system interfaces for inter-process communication.

php72-php-xml 

Dynamic shared objects which add support to PHP for manipulating XML documents using the DOM tree, and performing XSL transformations on XML documents.

php72-php-pecl-apcu

APC Caching Support

php72-php-gd 

Dynamic shared object that will add support for using the gd graphics library to PHP.

php72-php-intl 

Dynamic shared object that will add support for using the ICU library to PHP.

php72-php-mbstring

Dynamic shared object that will add support for multi-byte string handling to PHP

php72-php-pecl-mcrypt 

Deprecated, but still currently required. Support for the mcrypt encryption API.

php72-php-pdo

Dynamic shared object that will add a database access abstraction layer to PHP. This module provides a common interface for accessing MySQL, PostgreSQL or other databases.

php72-php-soap

Dynamic shared object that will add support to PHP for using the SOAP web services protocol.

php72-php-pecl-zip

Library for processing zip files

Optional PHP Modules

Name

Description

php72-php-mysqlnd

MySQL Support

php72-php-oci8

Oracle Support

php72-php-ldap

LDAP Support



Required Packages

Name

Description

Name

Description

php72

The PHP 7.2 Package

php72-php-fpm

PHP 7.2 FPM Service

mod_proxy_fcgi

Apache Proxy Mod

Upgrade Process

  1. Update all packages 

    yum update
    1. In some cases you may see this error: 

      The GPG keys listed for the "Percona-Release YUM repository - noarch" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository.



    2. To resolve, manually edit the repo file:

      vim /etc/yum.repos.d/percona-release.repo # change all instances of gpgcheck = 1 # to gpgcheck = 0 # save and close the file, then try to update again



  2. Reboot the server: 



  3. Make sure the EPEL repo is installed and active

    1. The following file should exist: 



    2. and contain the section [epel] with the value enabled=1

    3. If not, install the repo 




  4. Install the remi-safe repo: 



  5. Install PHP 7.2, FPM for PHP 7.2, and the Apache FPM Mod 



  6. Edit the php.ini file. This will typically be located at /etc/opt/remi/php72/php.ini. The following lines need to be updated: 



  7. Install the PHP modules required by PCR-360 

    1. If you experience an issue with installing dependencies for the Modules, you will either need to compile them yourself, or install the centos repo: 



  8. Install OCI8 Support ONLY if this is an Oracle Load:

    1. Support for this will require you Update the Oracle Instant Client to at at least version 18.1

    2. You will likely need to remove previous versions of SQL Plus 



    3. Start Here: Instant Client Install

    4. Then install the PHP72 Mod



  9. The defaults settings for PHP-FPM should be ok, but if you need to change anything (i.e. listening port), the config can be found at: 

    The default listening port may be changed at the following line 



  10. Edit the Virtual Host configuration. This is generally located in the default Virtual Hosts directory: 



    1. For Apache Version 2.2, two new directives need to be added:

      1. The placement of the new lines is especially important in Shibboleth configurations

      2. Just below the <Directory> directive, add the <Location> directive

      3. Just below the newly added <Location> directive, add the ProxyPassMatch 



    2. For Apache Version 2.4

      1. Tell PHP-FPM to listen to the socket. Edit /etc/opt/remi/php72/php-fpm.d/www.conf and change the line listen= ... to: 



      2. Find the listen.owner / .group / .mode lines and un-comment them. Also, change the user & group to whatever Apache runs as (usually "apache"). 



      3. Declare the proxy in a separate .conf file so we can re-use it. i.e.  /etc/httpd/conf.d/php72.conf 



      4. Edit the PCR360 <VirtualHost> and add the <FilesMatch> & SetHandler





  11. Start the FPM service 



  12. Verify the the service is listening on the configured port (default is 9000). 



  13. Enable the FPM service. Restart Apache and PHP 



  14. The application code can now be updated to version 2018.1+

IMPORTANT: These instructions are only for upgrade installations only. If you are installing a new server, or do not want to run PHP 7.2 alongside an older version please see the PHP 7.2 Install Instructions

Additionally, REDHAT 8 does not auto configure php-fpm as it does in previous versions, so for REDHAT 8, these instructions should be used:

Note to Licensed Customers:

The following information represents the process we use to upgrade hosted installations. 

  • The repos may vary depending the installation.

  • Licensed customers are welcome to use any repos they deem appropriate.

  • All modules listed under "Install the PHP modules required by PCR-360 " are required for PCR-360 to function correctly.

  • The only optional modules are the installation-specific modules listed below the required ones.

  • Zend Guard Loader is not supported in PHP 7.2, is not included in the required modules, and may be safely removed.

  • MCrypt has been deprecated in PHP 7.2, but is still available as an addon module.

  • In PCR-360 version 2019.1, we will be removing the usage of MCrypt in favor of OpenSSL encryption. For version 2018.1, MCrypt is still a required module.

Required PHP Modules

Name

Description

php72-php-process

Dynamic shared objects which add support to PHP using system interfaces for inter-process communication.

php72-php-xml 

Dynamic shared objects which add support to PHP for manipulating XML documents using the DOM tree, and performing XSL transformations on XML documents.

php72-php-pecl-apcu

APC Caching Support

php72-php-gd 

Dynamic shared object that will add support for using the gd graphics library to PHP.

php72-php-intl 

Dynamic shared object that will add support for using the ICU library to PHP.

php72-php-mbstring

Dynamic shared object that will add support for multi-byte string handling to PHP

php72-php-pecl-mcrypt 

Deprecated, but still currently required. Support for the mcrypt encryption API.

php72-php-pdo

Dynamic shared object that will add a database access abstraction layer to PHP. This module provides a common interface for accessing MySQL, PostgreSQL or other databases.

php72-php-soap

Dynamic shared object that will add support to PHP for using the SOAP web services protocol.

php72-php-pecl-zip

Library for processing zip files

Optional PHP Modules

Name

Description

php72-php-mysqlnd

MySQL Support

php72-php-oci8

Oracle Support

php72-php-ldap

LDAP Support



Required Packages

Name

Description

Name

Description

php72

The PHP 7.2 Package

php72-php-fpm

PHP 7.2 FPM Service

mod_proxy_fcgi

Apache Proxy Mod

Upgrade Process

  1. Update all packages 

    1. In some cases you may see this error: 



    2. To resolve, manually edit the repo file:



  2. Reboot the server: 



  3. Make sure the EPEL repo is installed and active

    1. The following file should exist: 



    2. and contain the section [epel] with the value enabled=1

    3. If not, install the repo 




  4. Install the remi-safe repo: 



  5. Install PHP 7.2, FPM for PHP 7.2, and the Apache FPM Mod 



  6. Edit the php.ini file. This will typically be located at /etc/opt/remi/php72/php.ini. The following lines need to be updated: 



  7. Install the PHP modules required by PCR-360 

    1. If you experience an issue with installing dependencies for the Modules, you will either need to compile them yourself, or install the centos repo: 



  8. Install OCI8 Support ONLY if this is an Oracle Load:

    1. Support for this will require you Update the Oracle Instant Client to at at least version 18.1

    2. You will likely need to remove previous versions of SQL Plus 



    3. Start Here: Instant Client Install

    4. Then install the PHP72 Mod



  9. The defaults settings for PHP-FPM should be ok, but if you need to change anything (i.e. listening port), the config can be found at: 

    The default listening port may be changed at the following line 



  10. Edit the Virtual Host configuration. This is generally located in the default Virtual Hosts directory: 



    1. For Apache Version 2.2, two new directives need to be added:

      1. The placement of the new lines is especially important in Shibboleth configurations

      2. Just below the <Directory> directive, add the <Location> directive

      3. Just below the newly added <Location> directive, add the ProxyPassMatch 



    2. For Apache Version 2.4

      1. Tell PHP-FPM to listen to the socket. Edit /etc/opt/remi/php72/php-fpm.d/www.conf and change the line listen= ... to: 



      2. Find the listen.owner / .group / .mode lines and un-comment them. Also, change the user & group to whatever Apache runs as (usually "apache"). 



      3. Declare the proxy in a separate .conf file so we can re-use it. i.e.  /etc/httpd/conf.d/php72.conf 



      4. Edit the PCR360 <VirtualHost> and add the <FilesMatch> & SetHandler





  11. Start the FPM service 



  12. Verify the the service is listening on the configured port (default is 9000). 



  13. Enable the FPM service. Restart Apache and PHP 



  14. The application code can now be updated to version 2018.1+