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:

  • 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.

  • 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.

  • 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.

  • 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.

  • 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

OSPackage TypeOS VersionPHP versions
EL 6 (CentOS, CloudLinux, Oracle Linux, etc.)RPM6.x5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
EL 7 (Amazon Linux 2, CentOS, CloudLinux, Oracle Linux, etc.)RPM7.x5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
EL 8 (AlmaLinux, CentOS, CentOS Stream, CloudLinux, Oracle Linux, etc.)RPM8.x5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
EL 9 (AlmaLinux, CentOS, CloudLinux, Oracle Linux, etc.)RPM9.x5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
EL 10 (AlmaLinux, CloudLinux, Oracle Linux, etc.)RPM10.x5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
UbuntuDEB16.045.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3
UbuntuDEB18.04, 20.045.2, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
UbuntuDEB22.04, 24.045.2, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
UbuntuDEB26.045.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
DebianDEB105.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
DebianDEB11, 125.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
DebianDEB135.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5
Alpine LinuxAPK3.23, 3.247.3, 7.4, 8.0, 8.1
Windows-Windows Server 2019, 2022, 20255.2, 5.4, 5.6, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2

Supported architectures:

  • x86_64 — all supported Linux OSes
  • aarch64/arm64 — Debian 12 and 13, Alpine Linux 3.23 and later
  • Windows — x64 (64-bit) and x86 (32-bit) builds

Other versions and architectures available upon request. Contact [email protected] for more information.

Installation on Linux

Prerequisites

  • A valid TuxCare ELS license key — contact [email protected] to obtain one

  • Root or sudo access to the server

  • Amazon Linux 2-specific. Before installing alt-php, make sure libvpx is installed. Amazon Linux 2 provides two versions 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 your license key (see Prerequisites above)

    The script registers the server with CLN, adds the PGP key and repository.

    sh install-els-alt-php-rpm-repo.sh --license-key XXX-XXXXXXXXXXXX

    Imunify customers

    If Imunify360 is installed on the server and has a valid license, you can install alt-php (HardenedPHP) without a separate ELS license key. Run the installer with the -i (--imunify) option instead of --license-key — your Imunify access credentials are used automatically for repository access:

    sh install-els-alt-php-rpm-repo.sh --imunify
  3. Install a PHP version

    Each version can be installed individually or all versions at once.

    yum groupinstall alt-php73

    To install all versions at the same time:

    yum groupinstall alt-php
  4. Verify the installation

    Check that the desired PHP version is installed:

    rpm -qa | grep alt-php

Useful Commands and Usage

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

Installation on Windows

TuxCare provides two ways to install ELS PHP on Windows: using the TuxCare Installer (recommended) — a graphical tool that automates the process, or manually by downloading and configuring PHP from the repository.

Prerequisites

  • A valid TuxCare ELS license key — contact [email protected] to obtain one
  • Administrator access to the Windows system

Customers who previously received an authentication token can continue to use it: select Use previous token in the TuxCare Installer, or use the tokenized URL for manual installation.

Choose installation method:

TuxCare Installer allows you to install and manage ELS PHP versions through a graphical interface on Windows Server 2019, 2022, and 2025.

  1. Download the installer and launch it

    Download the installer from the following link:

    https://windows.tuxcare.com/php/TuxCare.Installer.exe
    

    Run the downloaded file. After the first run, the installer appears under Settings > Apps.

  2. Select Register

    Click Register.

    TuxCare Installer selection window with the Register and Use previous token buttons

    If you previously registered on this machine with an authentication token and saved it, you can click Use previous token instead.

  3. Register with your license key

    • Click I have a license key.

      TuxCare Installer selection window with the I have a license key button highlighted

    • Enter your license key to complete the registration.

      TuxCare PHP installer prompting for a license key or authentication token

  4. Select a PHP version

    Tick the checkbox next to the version you want. Only 1 version can be installed per installation.

    TuxCare PHP installer listing the available PHP versions with a checkbox beside each

    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.

    TuxCare PHP installer highlighting an already-installed PHP version in green and asking whether to replace it or install alongside it

  5. Choose installation path and load modules

    • By default, the installer uses C:\Program Files.
    • Click Change to install to a different location.
    • Click Load to fetch the required PHP archive.
    • Select the modules you need and click Continue.

    TuxCare PHP installer showing the installation path and the list of PHP modules available to select

  6. Verify the installation

    Open Command Prompt, PowerShell, or Terminal and run:

    php -v
    

    You should see output like:

    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
    

During installation, the installer creates a folder with PHP configuration and selected modules, and adds TuxCare PHP to the System PATH.


How to find System PATH
  1. Right-click This PC and select Properties, or search for Settings > System > About in the Start menu.

  2. Click Advanced system settings.

    Windows System window with the Advanced system settings link highlighted

  3. Click on Environment Variables.

    Advanced tab of Windows System Properties with the Environment Variables button highlighted

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

    Windows Environment Variables dialog with the Path entry selected under System variables

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

    Windows Edit environment variable dialog showing the PHP installation directory added to Path

Additional configurations

Depending on your ELS PHP usage purpose, additional configurations may be required. You can integrate PHP with other tools, for example, IIS or WordPress. For further details, refer to the official PHP documentation.

Change default PHP version

If you have multiple PHP versions installed and want to change the default, update your System Path environment variable. Open Settings > System > About → Advanced system settings → Environment Variables. Under System variables, find Path and click Edit. Move the desired PHP version's path to the top, and remove or move down other PHP paths. Click OK, restart your terminal, and verify with php -v.

Extensions

Extensions are managed through the php.ini file located in your PHP installation directory (e.g. C:\PHP). Open it in a text editor and find the extensions section. Remove the semicolon ; at the beginning of a line to enable an extension, or add ; to disable it.

;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. Open the php.ini file and set the values as needed:

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

Uninstallation

To uninstall a PHP version manually, delete the PHP installation directory (e.g. C:\PHP) and remove the corresponding path from System Path.

To uninstall via TuxCare Installer, open Settings > Apps, find TuxCare Installer and click Uninstall.

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+ (required for PHP 8.2+ compatibility) — download from saxonica.com
  • httpd (or apache2), gcc-c++ (or g++) with minimum C++14 support
  • alt-php82-devel (or matching version)
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

Set up SaxonC

  1. Download SaxonC

    Download from the official Saxonica download page. Create a working directory and move the downloaded zip file into it:

    mkdir saxon && cd saxon
    mv ../SaxonCHE-linux-x86_64-12-9-0.zip .
    
  2. Extract the archive

    Unzip the downloaded file and verify:

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

    Example output:

    SaxonCHE-linux-x86_64-12-9-0  SaxonCHE-linux-x86_64-12-9-0.zip
    
  3. Install the libraries

    Starting with version 12.6, /opt/saxonica/ is the recommended installation path. Navigate into the extracted directory and copy all Saxon files:

    cd SaxonCHE-linux-x86_64-12-9-0
    sudo mkdir -p /opt/saxonica/
    sudo cp -r SaxonCHE/* /opt/saxonica/
    

    The installed structure should contain bin, include, and lib directories.

  4. Configure environment variables

    Add the following lines to your .bashrc or /etc/profile.d/saxon.sh.

    The LD_LIBRARY_PATH variable must point to the Saxon libraries:

    export LD_LIBRARY_PATH="/opt/saxonica/lib:$LD_LIBRARY_PATH"
    

    To run the Transform, Query, and Validate (EE only) binaries, set the PATH variable:

    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.

Build the PHP extension

  1. Install alt-php82-devel

    Install the development package required for compiling PHP extensions:

    dnf install alt-php82-devel
    

    Verify that phpize is available:

    ls /opt/alt/php82/usr/bin/phpize
    
  2. Prepare the build environment

    Navigate to the PHP extension source directory within the extracted Saxon archive and run phpize to prepare the build:

    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
    
  3. Configure and compile

    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"
    

    Compile and install:

    make
    sudo make install
    

    Example output:

    Installing shared extensions:     /opt/alt/php82/usr/lib64/php/modules/
    
  4. Enable the extension

    Create a configuration file that tells PHP to load the extension:

    tee -a /opt/alt/php82/etc/php.d/20-saxon.ini <<EOF
    ; configuration for php Saxon HE/PE/EE module
    extension=saxon.so
    EOF
    

    Verify that the Saxon extension appears in the list of loaded modules:

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

    Example output:

    saxonc
    
  5. Verify with a test script

    Run a quick test to confirm the extension 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/>
    

    If you are using php-fpm or Apache, restart the services.

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.

What's Next?