sidebar hamburger menu

PHP

Endless Lifecycle Support (ELS) for PHP from TuxCare provides security fixes for PHP versions that have reached their end-of-life. This allows you to continue running your server vulnerability-free.

About ALT-PHP

alt-php is a component provided by TuxCare designed for managing PHP versions on web servers and enabling users to choose PHP versions for their websites.

Here are the key features and characteristics of alt-php:

  1. Multiple PHP Versions - alt-php allows the installation and usage of various PHP versions on a single web server. This enables users to select the PHP version that best suits their web applications.

  2. User Segmentation - alt-php allows hosting providers and web server administrators to provide different PHP versions for different users. Each user can choose the PHP version that suits their website.

  3. Enhanced Compatibility - alt-php is designed to ensure maximum compatibility with various web applications and frameworks. This includes optimizations and changes to make it compatible with a wide range of PHP applications.

  4. Updates and Support - CloudLinux provides regular updates for alt-php, including bug fixes, performance improvements, and updates for new PHP versions. This helps ensure the security and currency of PHP usage.

  5. Management Tools - alt-php usually comes with a set of management tools, such as PHP Selector, allowing users to manage PHP versions and enable/disable various PHP extensions.

alt-php provides a more flexible and convenient environment for working with different PHP versions on a single server, which is particularly useful in a web hosting environment where multiple users have varying requirements for PHP versions for their web applications.

Supported OS and PHP versions

Supported architecture: 64-bit.

OSPackage TypeOS Version
EL 7 ( Amazon Linux 2, CentOS, CloudLinux, Oracle Linux, etc.)RPM7.x
EL 8 ( AlmaLinux, CentOS, CentOS Stream, CloudLinux, Oracle Linux, etc.)RPM8.x
EL 9 ( AlmaLinux, CentOS, CloudLinux, Oracle Linux, etc.)RPM9.x
EL 10 ( AlmaLinux, CloudLinux, Oracle Linux, etc.)RPM10.x
UbuntuDEB16.04, 18.04, 20.04, 22.04, 24.04
DebianDEB10, 11, 12, 13
Windows-Windows Server 2019, 2022, 2025

For supported PHP versions, see cve.tuxcare.com.

Other distros and architectures upon request.

Installation Instructions for Linux

Get user credentials

  1. Obtain the required license to get access to the service.
  2. Contact sales@tuxcare.com to receive instructions for generating your unique access link (tokenized URL). Anonymous access is restricted.

Install ALT-PHP

The following steps are provided for both RPM-based (CentOS, CentOS Stream, CloudLinux, Oracle Linux, AlmaLinux, Amazon Linux 2, etc) and DEB-based (Debian, Ubuntu) systems. Please select the appropriate tab for your distribution.

Amazon Linux 2-specific preprequisities. Before installing alt-php, make sure libvpx is installed. Amazon Linux 2 provides two version of libvpx: 1.9 (the default) and 1.3. alt-php requires 1.3 for compatibility with EL 7 systems like CentOS 7:

sudo yum install libvpx-1.3.0
  1. Download the installer script:

    wget https://repo.alt.tuxcare.com/alt-php-els/install-els-alt-php-rpm-repo.sh
  2. Run the installer script with keys. The installation script registers the server in the CLN with the key, adds the yum repository, and adds a PGP key to the server.

    sh install-els-alt-php-rpm-repo.sh --license-key XXX-XXXXXXXXXXXX
  3. Verify that the installation was successful.

    To ensure the installation has been completed successfully, run the following command. It should return info about a package. If information about the package is available it means that installation was successful. After which, updates will be available for installation from the repository using the usual command:

    yum upgrade
  4. Install PHP package. Each version of PHP can be installed individually or all versions at once.

    • Standard commands to install each version separately, for example, installing alt-php73:

      yum groupinstall alt-php73
    • To install all versions at the same time:

      yum groupinstall alt-php
    • To find out which groups/meta-package are available for installation, use the following command:

      sudo yum group list

      For example:

      sudo yum group list 
      ............
      
      Available Environment Groups:
        Server with GUI
        Server
        Minimal Install
        CloudLinux OS Admin (minimal)
        CloudLinux OS Solo (minimal)
        Workstation
        Custom Operating System
        Virtualization Host
      Available Groups:
        alt-nodejs
        alt-nodejs10
        alt-nodejs11
        alt-nodejs12
        alt-nodejs14
        alt-nodejs6
        alt-nodejs8
        alt-nodejs9
        alt-php
        alt-php44
        alt-php51
        alt-php52
      ..................
        alt-ruby30
        alt-ruby31
        alt-ruby32
    • To get a list of packages of a specific group or meta package, use the following command:

      sudo yum groupinfo alt-phpXY

      Replace XY with a version of alt-php. For example:

      sudo yum groupinfo alt-php72 
      ............
      
      Group: alt-php72
      Description: PHP 7.2.x packages for CloudLinux OS PHP Selector
      Default Packages:
        alt-php72
        alt-php72-bcmath
        alt-php72-brotli
        alt-php72-cli
        alt-php72-common
        alt-php72-dba
        alt-php72-devel
        ................
        alt-php72-xml
        alt-php72-xmlrpc

    Important!

    When executing the apt command, a warning may appear:

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    

    The apt commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use. All features of apt are available in dedicated APT tools like apt-get and apt-cache as well.  apt just changes the default value of some options. Therefore, we recommend using these commands (potentially with some additional options enabled) as they keep backward compatibility as much as possible.

Useful Commands and Usage of PHP ELS

When you deploy an updated version of PHP through PHP ELS, using your system's regular update tool (yum, dnf, apt) the new version will be installed under /opt/alt/php[version]/. This means that all modules, configurations and additional files pertaining to this version will be contained inside that path. Different versions of PHP will each have their own path and can coexist without issues on the same system. Below you will find the location of all the relevant files, should you want to make any changes.

To check whether the package is installed and see its current version, use the following command based on your OS:

sudo yum list installed | grep php

For example, alt-php73:

sudo yum list installed | grep php 
  ............
  alt-php-config.noarch                       1-54.el8                                               @cloudlinux-updates-testing
  alt-php-internal.x86_64                     7.4.33-6.el8                                           @cloudlinux-updates-testing
  alt-php-internal-cli.x86_64                 7.4.33-6.el8                                           @cloudlinux-updates-testing
  alt-php-internal-common.x86_64              7.4.33-6.el8                                           @cloudlinux-updates-testing
  alt-php-internal-intl.x86_64                7.4.33-6.el8                                           @cloudlinux-updates-testing
  alt-php-internal-mbstring.x86_64            7.4.33-6.el8                                           @cloudlinux-updates-testing
  alt-php-libc-client11.x86_64                2007f-3.el8                                            @cloudlinux-updates-testing
  alt-php-ssa.x86_64                          0.4-3.el8                                              @AppStream

  alt-php73.x86_64                            1:7.3.33-18.el8                                        @cloudlinux-updates-testing
  alt-php73-apm-agent.x86_64                  1.9.0-1.el8                                            @cloudlinux-updates-testing
  alt-php73-bcmath.x86_64                     1:7.3.33-18.el8                                        @cloudlinux-updates-testing
  alt-php73-bcmath-debuginfo.x86_64           1:7.3.31-2.el8                                         @cloudlinux-updates-testing
  alt-php73-brotli.x86_64                     0.5.0-2.el8                                            @cloudlinux-x86_64-server-8
  .....................
  alt-php73-xmlrpc-debuginfo.x86_64           1:7.3.31-2.el8                                         @cloudlinux-updates-testing

SaxonC Use Case

You can extend alt-php with additional modules. Below is an example of installing the SaxonC PHP extension.

Although this guide uses alt-php82 in its examples, the same installation steps apply to alt-php83 and newer versions. Replace php82 with your target version in all commands and file paths.

This guide also uses SaxonC-HE as an example. Be sure to adjust file names and paths to match the version you downloaded.

Prerequisites

Saxon 12 is required for PHP 8.2+ compatibility. There are three versions of the SaxonC product. SaxonC-HE is the open source version, while other professional editions (PE and EE) are available for commercial use.

EditionLicenseKey Features
SaxonC-HEOpen SourceXSLT 3.0, XPath 3.1, XQuery 3.1 (Basic)
SaxonC-PECommercialHE + ICU localization, JSON support
SaxonC-EECommercialPE + Schema validation, Optimization

To build the PHP extension, ensure the following packages are installed: httpd (or apache2), gcc-c++ (or g++) with minimum C++14 support.

Download SaxonC

  1. Download SaxonC from the official Saxonica download page.

  2. Create a working directory and navigate into it. Move the downloaded zip file into the working directory and extract the archive

    mkdir saxon && cd saxon
    mv ../SaxonCHE-linux-x86_64-12-9-0.zip .
    unzip SaxonCHE-linux-x86_64-12-9-0.zip
    
  3. Verify the extraction:

    ls
    

    Example output:

    SaxonCHE-linux-x86_64-12-9-0  SaxonCHE-linux-x86_64-12-9-0.zip
    

Install the libraries

Starting with version 12.6, /opt/saxonica/ is the recommended installation path for Saxon libraries.

  1. Navigate into the extracted directory and create the target directory for Saxon installation.

    cd SaxonCHE-linux-x86_64-12-9-0
    mkdir /opt/saxonica/
    
  2. Copy all Saxon files (binaries, headers, libraries) to the installation directory

    sudo cp -r SaxonCHE/* /opt/saxonica/
    
  3. Verify the installation structure

    ls /opt/saxonica/
    

    Example output:

    bin  include  lib
    
  4. Add the following lines to your .bashrc or /etc/profile.d/saxon.sh:

    • The LD_LIBRARY_PATH variable must be set to the location of the lib directory containing the SaxonC libraries.

      export LD_LIBRARY_PATH="/opt/saxonica/lib:$LD_LIBRARY_PATH"
      
    • To run the Transform, Query, and Validate (EE only) binaries the PATH variable can be set.

      export PATH="/opt/saxonica/bin:$PATH"
      

    If the PHP web server can't find the Saxon libraries, you may also need to add /opt/saxonica/lib to a new file in /etc/ld.so.conf.d/ and run ldconfig.

Install alt-php82-devel

  1. Install the development package for alt-php82:

    dnf install alt-php82-devel
    
  2. Verify that phpize required for compiling PHP extensions is available:

    ls /opt/alt/php82/usr/bin/phpize
    

    Example output:

    /opt/alt/php82/usr/bin/phpize
    

Build the PHP extension

Now you can compile the Saxon PHP extension from source. The build process uses the standard PHP extension compilation workflow: phpize prepares the build environment, configure sets up the build options, and make compiles the extension.

  1. Navigate to the PHP extension source directory within the extracted Saxon archive and prepare the build environment.

    cd php/src/
    /opt/alt/php82/usr/bin/phpize
    

    Example output:

    Configuring for:
    PHP Api Version:         20220829
    Zend Module Api No:      20220829
    Zend Extension Api No:   420220829
    
  2. Configure the extension build with Saxon support and link to the Saxon libraries

    ./configure --with-saxon --with-php-config=/opt/alt/php82/usr/bin/php-config LDFLAGS="-L/opt/saxonica/lib"
    
  3. Compile the extension

    make
    
  4. Install the compiled extension to the PHP modules directory

    sudo make install
    

    Example output:

    Installing shared extensions:     /opt/alt/php82/usr/lib64/php/modules/
    

Enable and verify the extension

  1. After installation, you need to enable the extension by creating a configuration file that tells PHP to load it.

    tee -a /opt/alt/php82/etc/php.d/20-saxon.ini <<EOF
    ; configuration for php Saxon HE/PE/EE module
    extension=saxon.so
    EOF
    
  2. Verify that the Saxon extension appears in the list of loaded modules:

    /opt/alt/php82/usr/bin/php -m | grep saxon
    

    Example output:

    saxonc
    
  3. Test that it works:

    /opt/alt/php82/usr/bin/php -ddisplay_errors=E_ALL  << 'EOF'
    <?php
      $saxonProc = new Saxon\SaxonProcessor();
      $transformer = $saxonProc->newXslt30Processor();
      $executable = $transformer->compileFromString("
        <xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
            <xsl:template name='go'><a/></xsl:template>
        </xsl:stylesheet>
    ");
      $root = $executable->callTemplateReturningValue("go");
      $node = $root->getHead()->getNodeValue();
      echo "$node \n";
    EOF
    

    Example output:

    <a/>
    
  4. If you are using php-fpm or Apache, restart the services.

Installation Instructions for Windows

Get user credentials

  1. Obtain the required license to get access to the service.
  2. Contact sales@tuxcare.com to receive instructions for generating your unique access link (tokenized URL). Anonymous access is restricted.

Download and Install TuxCare PHP Windows

TuxCare provides a Windows Installer that allows you to install and manage ELS PHP versions.

  1. Follow the instructions provided by sales@tuxcare.com to create your secure download link.

  2. Use this link to download the latest version of the installer.

  3. Launch the installer. After the first run, it will appear under Settings > Apps.

  4. Provide you access credentials:

    • Register - if this is your first time using the installer or you're installing on a new system, choose the "Register" option. You’ll be asked to provide your license key or authentication token. You can also save your token for future use.

    image

    • Use previous token - if you’ve already registered on this machine and chose to save your credentials, the installer will detect and use the saved token automatically. You won’t need to enter your credentials again unless the token is missing or expired.
  5. Select a PHP version and tick the checkbox next to it. Only 1 version can be installed per installation.

    image

    If you already have a version installed, it will appear highlighted in green. When another version is selected, the installer will ask whether to replace the existing one or install it alongside.

    image

  6. Choose Installation Path. By default, the installer will use C:\Program Files. Click Change if you want to install to a different location.

  7. Click Load to fetch the required PHP archive. Once the archive is loaded, a list of available PHP modules will appear. Select the modules you need and click Continue to confirm.

    image

  8. During installation, the installer will create a folder with PHP configuration and selected modules, and add TuxCare PHP to the System PATH (advanced settings).

    Click to see more
    1. Right-click This PC and select Properties, or search for Settings > System > About in the Start menu.
    2. Click Advanced system settings.

    image

    1. Click on Environment Variables.

    image

    1. Under System variables, find Path and click Edit.

    image

    1. You will see your PHP C:\PHP directory added.

    image

  9. Wait for the installation process to complete.

Validate the Installation

To confirm PHP is working:

  1. Open Command Prompt, PowerShell, or Terminal.

  2. Run the following command:

    php -v
    

    You should see output like this:

    PHP 5.6.40 (cli) (built: May 30 2025 15:43:43)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    

Additional configurations (optional)

Depending on your ELS PHP usage purpose, additional configurations may be required. Here are some commonly useful configurations.

Change Default PHP Version

If you have multiple PHP versions installed and want to change the default, update your System Path environment variable:

  1. Open Settings > System > About in the Start menu.

  2. Click Advanced system settings.

  3. Click on Environment Variables.

  4. Under System variables, find Path and click Edit.

    • Move the desired PHP version’s path to the top.
    • Remove or move down other PHP paths.
  5. Click OK and restart your terminal

  6. Verify the active PHP version by running:

    php -v
    

Extensions

To enable or disable extensions in your installed PHP version:

  1. Navigate to your PHP installation directory, e.g. C:\PHP directory.

  2. Open the php.ini file in an editor of your choice (e.g. Notepad).

  3. Edit the list of extensions:

    • To enable an extension, remove the semicolon ; at the beginning of the line.
    • To disable an extension, add a semicolon ; at the beginning of the line.

    Example:

    ;extension=curl
    extension=gd2
    ;extension=mbstring
    extension=mysqli
    extension=pdo_mysql
    

Increase Upload/Memory Limits

If you're integrating PHP with applications like WordPress, you might need to increase memory and upload size limits:

  1. Open the php.ini file in an editor of your choice (e.g. Notepad).

  2. Set the limits as needed, e.g:

    upload_max_filesize=40M
    post_max_size=40M
    memory_limit=256M
    

Example Use Cases

You can integrate PHP with other tools, for example, IIS or WordPress. For further details and documentation, refer to the official PHP documentation.

Uninstallation

Uninstall a PHP version,

To uninstall a PHP version:

  1. Manually delete the PHP installation directory (e.g., C:\Program Files\TuxCare\php-version).

  2. Remove the PHP path from System Path.

Uninstall TuxCare Installer

To uninstall TuxCare Installer:

  1. Open Settings > Apps.

  2. Find TuxCare Installer and click Uninstall to remove it from the list of installed apps.

OVAL data

This section contains information about available ELS for PHP OVAL streams that can be used by vulnerability scanners.

TuxCare PHP ELS OVAL Streams

Currently, we provide OVAL data for the following OS versions:

How to use OVAL

OVAL can be used with the OpenSCAP tool.

  1. Install OpenSCAP

    yum install openscap openscap-utils scap-security-guide -y
  2. Download an OVAL stream. For example, EL 8:

    wget https://security.tuxcare.com/oval/els_alt_php/el8/oval.xml
    
  3. Run a scan:

    oscap oval eval --results result.xml --report report.xml oval.xml
    

Common Security Advisory Framework

Common Security Advisory Framework (CSAF) is a machine-readable format, standardized by OASIS. It's designed to enable consistent and automated sharing of security advisory information.

TuxCare publishes the following CSAF files at security.tuxcare.com:

  • CSAF Vulnerability Exploitability eXchange (VEX) files – indexed by CVE VEX documents are available in CSAF 2.0 format, including past CVEs.
  • CSAF Security Advisory files – advisories are published in CSAF 2.0 format and indexed by Security Advisory.

provider-matadata.json contains information for tools and users about where and how to retrieve CSAF advisories published by TuxCare. By OASIS requirements, it is available at two URLs (both serving the same file):

TuxCare CSAF data

Currently, we provide CSAF data for the following OS versions:

How to Use CSAF

The CSAF files are published in JSON format which is easy to parse and integrate with other tools - OASIS provides a list of reference tools that support CSAF.

Errata

Currently, we provide errata for the following OS versions:

RSS Feed

PHP extensions list

PHP extensions are modules that extend the functionality of the PHP programming language. These extensions provide additional capabilities for working with various types of data, performing specific tasks, interacting with external resources and supporting various protocols.

The PHP core includes many built-in extensions that provide basic functionality, such as working with databases, string processing, working with images, and others. However, to support more specific tasks and third-party libraries, you can use additional PHP extensions.

Reflection
SPL
SimpleXML
apc
apm
ares
bcmath
bcompiler
big_int
bitset
bloomy
bz2
bz2_filter
calendar
coin_acceptor
crack
ctype
curl
date
dba
dbase
dbx
dom
doublemetaphone
eaccelerator
enchant
exif
ffmpeg*
fileinfo
filter
ftp
gd
gender
geoip
geos
gettext
gmagick
gmp
gnupg
haru
hash
hidef
htscanner
http
huffman
iconv
idn
igbinary
imagick
imap
inclued
inotify
interbase
intl
ioncube_loader
json
ldap
libxml
lzf
mailparse
mbstring
mcrypt
memcache
memcached
mhash
mongo
msgpack
mssql
mysql
mysqli
ncurses
oauth
odbc
opcache
openssl
pcntl
pcre
pdf
pdo
pdo_dblib
pdo_firebird

pdo_mysql
pdo_oci*
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
phar
posix
pspell
quickhash
radius
rar
readline
recode
redis
rsync
session
shmop
snmp
soap
sockets
sourceguardian
spl_types
sqlite
ssh2
standard
stats
stem
stomp
suhosin
sybase_ct
sysvmsg
sysvsem
sysvshm
tidy
timezonedb
tokenizer
translit
uploadprogress
uuid
wddx
xcache
xcache_3
xdebug
xhprof
xml
xmlreader
xmlrpc
xmlwriter
xrange
xsl
yaf
yaz
zend_optimizer
zip
zlib

* CentOS 7, CloudLinux 7, etc.

Conclusion

As you can see, each version is entirely self-contained, and changing configurations in one will not impact the others, a desired feature in hosting environments.

PHP Changelog

To stay informed about the latest updates, fixes, and enhancements for ALT-PHP, please refer to the CloudLinux Changelog. All PHP ELS package updates are published there as part of the CloudLinux update stream.

×
Need help?
I'm a multilingual AI chatbot, trained to answer all your questions!