(2022.1) 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: The following information represents the process we use to upgrade hosted installations. Dynamic shared object that will add support to PHP for using the SOAP web services protocol.Note to Licensed Customers:
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 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 |
---|---|
php72 | The PHP 7.2 Package |
php72-php-fpm | PHP 7.2 FPM Service |
mod_proxy_fcgi | Apache Proxy Mod |
Upgrade Process
Update all packages
yum update
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.
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
Reboot the server:
reboot now
- Make sure the EPEL repo is installed and active
The following file should exist:
/etc/yum.repos.d/epel.repo
and contain the section [epel] with the value enabled=1
If not, install the repo
## RHEL/CentOS 6 64-Bit ## # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm ## RHEL/CentOS 7 64-Bit ## # wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # rpm -ivh epel-release-latest-7.noarch.rpm
Install the remi-safe repo:
# Redhat 6 or CentOS 6 yum -y install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm # Redhat 7 or CentOS 7 yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Install PHP 7.2, FPM for PHP 7.2, and the Apache FPM Mod
yum -y install php72 php72-php-fpm mod_proxy_fcgi
Edit the php.ini file. This will typically be located at /etc/opt/remi/php72/php.ini. The following lines need to be updated:
# Set max memory to 1 Gb memory_limit = 1024M # Set the max file upload size to 10 Megabytes upload_max_filesize = 10M # This would need to be set to the timezone in which the Server is located date.timezone = America/Detroit
Install the PHP modules required by PCR-360
yum -y install php72-php-process php72-php-xml php72-php-pecl-apcu php72-php-gd php72-php-intl php72-php-mbstring php72-php-pecl-mcrypt php72-php-pdo php72-php-soap php72-php-pecl-zip # Optional (installation dependant) Packages # MySql support yum -y install php72-php-mysqlnd # LDAP Support yum -y install php72-php-ldap
If you experience an issue with installing dependencies for the Modules, you will either need to compile them yourself, or install the centos repo:
vim /etc/yum.repos.d/centos.repo [centos] name=CentOS $releasever - $basearch baseurl=http://ftp.heanet.ie/pub/centos/6/os/$basearch/ enabled=1 gpgcheck=0
- Install OCI8 Support ONLY if this is an Oracle Load:
Support for this will require you Update the Oracle Instant Client to at at least version 18.1
You will likely need to remove previous versions of SQL Plus
# This command will vary depending on the version installed rpm -e oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_6
Start Here: Instant Client Install
/wiki/spaces/PCRIN/pages/17266319hen install the PHP72 Mod
# Oracle Support yum -y install php72-php-oci8
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:
/etc/opt/remi/php72/php-fpm.d/www.conf
The default listening port may be changed at the following line
listen = 127.0.0.1:9000
Edit the Virtual Host configuration. This is generally located in the default Virtual Hosts directory:
/etc/httpd/conf.d/<vhost_name>.conf
- For Apache Version 2.2, two new directives need to be added:
- The placement of the new lines is especially important in Shibboleth configurations
- Just below the <Directory> directive, add the <Location> directive
Just below the newly added <Location> directive, add the ProxyPassMatch
# DIRECTORY-based Setup: This is the most common used on customer loads <VirtualHost> # This is just an example ServerName. The value should already be present and does not need to be altered ServerName servername.domain.com ... <Directory /var/www/pcr360/test/public> ... </Directory> # Just below the <Directory> directive, add the <Location> directive # Proxy to php72 on fpm <Location /> Order allow,deny Allow from all </Location> # Just below the newly added <Location> directive, add the ProxyPassMatch ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/pcr360/test/public/$1 disablereuse=off timeout=900 ... </VirtualHost>
- For Apache Version 2.4
Tell PHP-FPM to listen to the socket. Edit /etc/opt/remi/php72/php-fpm.d/www.conf and change the line listen= ... to:
listen = /var/run/php72.sock
Find the listen.owner / .group / .mode lines and un-comment them. Also, change the user & group to whatever Apache runs as (usually "apache").
listen.owner = apache listen.group = apache listen.mode = 0660
Declare the proxy in a separate .conf file so we can re-use it. i.e. /etc/httpd/conf.d/php72.conf
<Proxy "unix:/var/run/php72.sock|fcgi://php-fpm72"> ProxySet disablereuse=off ProxySet timeout=900 </Proxy>
Edit the PCR360 <VirtualHost> and add the <FilesMatch> & SetHandler:
<VirtualHost> # This is just an example ServerName. The value should already be present and does not need to be altered ServerName servername.domain.com ... <FilesMatch \.php$> SetHandler proxy:fcgi://php-fpm72 </FilesMatch> ... </VirtualHost>
- For Apache Version 2.2, two new directives need to be added:
Start the FPM service
# RedHat 6 and CentOS 6 service php72-php-fpm start # RedHat 7 and CentOS 7 systemctl start php72-php-fpm
Verify the the service is listening on the configured port (default is 9000).
netstat -plnt Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 4262/php-fpm
Enable the FPM service. Restart Apache and PHP
# RedHat 6 and CentOS 6 chkconfig php72-php-fpm on && service httpd restart && service php72-php-fpm restart # RedHat 7 and CentOS 7 systemctl enable httpd php72-php-fpm && systemctl restart httpd php72-php-fpm
- The application code can now be updated to version 2018.1+