# PHP Versions and Modules
# PHP Versions
Each website has control of its own PHP (opens new window) version. By default, 8.1 is configured on all new websites added to an Enhance cluster. Additional domains mapped to a website (add-on domains) use the same PHP version as the primary (root) domain.
The default PHP version and supported PHP versions can be configured on a per package basis.
Enhance currently supports the following PHP versions by default. More are being added.
- PHP 8.3
- PHP 8.2
- PHP 8.1 [default]
- PHP 8.0
- PHP 7.4
- PHP 7.3
- PHP 7.2
- PHP 7.1
- PHP 7.0
- PHP 5.6
The following PHP versions are supported but require manual installation on your platform:
WARNING
PHP versions PHP 5.2, PHP 5.3, PHP 5.4 and PHP 5.5 are deprecated.
- 5.5
- 5.4
- 5.3
- 5.2
# PHP package settings (Default php version and Supported php versions)
It is possible to set a default PHP version and supported PHP versions on a per package basis.
A default php version will ensure that all websites added to that package use the chosen default version.
Supported php versions will allow the user to select their preferred php version from; a. All current and future php versions permitted: The user will be able to select from all existing php versions (as above). New php versions added to Enhance will automatically be made available on the package. b. Customise supported php versions: The user will be able to select from preselect php versions. New php version added to Enhance will manually need to be added to the package.
TIP
- Packages created prior to this feature being available (04/08/2023) will automatically support all php versions and have their default php version will be set to 8.1.
- php 5.6 - 7.4 are end of life. These versions should only be offered to your customers if absolutely necessary (for example if a site which relies on an old php version is being transferred in). Supporting these php versions may leave users exposed to unpatched security vulnerabilities.
- If you choose to later retire a php version and remove its support from a package, websites on that package that are utilising that php version will continue to use it. If the user later changes this php version, they will only be able to select from the packages supported versions.
- When selecting a default php version for a package please be aware that php 5.6, 7.0, 7.1, 7.2 and 7.3 are not supported by WordPress.
To set a Default php version and Supported php versions on a pagkage:
- Select Settings from the left side menu
- Select Packages
- Scroll to Features and select your preference
- Then select your chosen Default php version
- Click Add package to save
# Default PHP Modules
The following PHP modules are installed on Enhance by default:
- Redis (PHP 7.0 and above)
- Curl
- GD
- FreeType
- XPM
- Zip
- Opcache
- Mhash
- FTP
- Mbstring
- Sodium
- PDO Sqlite
- PDO MySQL
- OpenSSL
- Zlib
- Exif
- Tidy
- XSL
- BcMath
- XML RPC
- IMAP
- GMP
- Intl (PHP 7.1 and above)
- Webp (PHP 7.4 and above)
- Imagick
- Mailparse (PHP 7.4 and above)
- PCNTL
- Sockets
- LDAP
# Compile custom PHP Module
It is possible to extend the supported modules using PECL (PHP Extension Community Library).
To add an additional module:
On the server which hosts the website which you would like to add the module to, run:
apt update
apt install make gcc g++ autoconf
opt/ecp-php81/bin/pecl install nameofmodule
- Replace php81 with the version of PHP you are using
- Replace nameofmodule with the module you would like to install
TIP
Your module may require system libraries which are not yet installed. If you receive an error at compile time, you can usually install the missing libraries with apt-get
.
On the website you would like to enable the module on visit developer tools and add a directive in the php.ini editor called “extension” with the value “nameofmodule”