When TuxCare ELS PHP versions are installed through cPanel, the PHP packages and extension files may be present but many standard extensions are not automatically enabled in the active ALT-PHP configuration.
This can cause sites to report missing extensions such as:
-
mysqli
-
mysqlnd
-
PDO
-
pdo_mysql
-
json
-
GD
-
mbstring
-
intl
-
fileinfo
-
bcmath
-
soap
-
XMLReader
-
XMLWriter
-
ZIP
-
DOM
The following process enables the standard PHP extensions for ALT-PHP 7.2, 7.4, and 8.2.
1. Install the Common Extension Packages
Install the standard packages for PHP 7.2:
dnf install -y \
alt-php72-bcmath \
alt-php72-gd \
alt-php72-intl \
alt-php72-mbstring \
alt-php72-mysqlnd \
alt-php72-soap \
alt-php72-xml
Install the standard packages for PHP 7.4:
dnf install -y \
alt-php74-bcmath \
alt-php74-gd \
alt-php74-intl \
alt-php74-mbstring \
alt-php74-mysqlnd \
alt-php74-soap \
alt-php74-xml
Install the standard packages for PHP 8.2:
dnf install -y \
alt-php82-bcmath \
alt-php82-gd \
alt-php82-intl \
alt-php82-mbstring \
alt-php82-mysqlnd \
alt-php82-soap \
alt-php82-xml
Do not assume every PHP extension has a package with the same name.
For example, packages such as these may not exist:
alt-php72-curl
alt-php72-zip
alt-php72-fileinfo
alt-php72-imagick
Many extension modules are included through other ALT-PHP packages.
2. Understand the ALT-PHP Configuration Layout
Each TuxCare PHP version uses directories similar to:
/opt/alt/php72/etc/php.d/
/opt/alt/php74/etc/php.d/
/opt/alt/php82/etc/php.d/
TuxCare also installs standard extension configuration files under:
/opt/alt/php72/etc/php.d.std/
/opt/alt/php74/etc/php.d.std/
/opt/alt/php82/etc/php.d.std/
The important part is this:
Having an extension configuration file in php.d.std does not necessarily mean PHP is loading it.
The extension must also be available from the active php.d directory.
On a fresh cPanel TuxCare ELS installation, php.d may contain little more than:
default.ini
while the actual extension configurations are sitting unused inside php.d.std.
3. Enable MySQL, JSON, and mysqli
For PHP 7.2:
ln -s /opt/alt/php72/etc/php.d.std/mysqlnd.ini /opt/alt/php72/etc/php.d/20-mysqlnd.ini
ln -s /opt/alt/php72/etc/php.d.std/nd_mysqli.ini /opt/alt/php72/etc/php.d/30-mysqli.ini
ln -s /opt/alt/php72/etc/php.d.std/json.ini /opt/alt/php72/etc/php.d/20-json.ini
For PHP 7.4:
ln -s /opt/alt/php74/etc/php.d.std/mysqlnd.ini /opt/alt/php74/etc/php.d/20-mysqlnd.ini
ln -s /opt/alt/php74/etc/php.d.std/nd_mysqli.ini /opt/alt/php74/etc/php.d/30-mysqli.ini
ln -s /opt/alt/php74/etc/php.d.std/json.ini /opt/alt/php74/etc/php.d/20-json.ini
For PHP 8.2:
ln -s /opt/alt/php82/etc/php.d.std/mysqlnd.ini /opt/alt/php82/etc/php.d/20-mysqlnd.ini
ln -s /opt/alt/php82/etc/php.d.std/nd_mysqli.ini /opt/alt/php82/etc/php.d/30-mysqli.ini
PHP 8.2 has JSON built into PHP itself, so a separate json.ini is not required.
4. Enable the Standard PHP Extensions
Run:
for v in 72 74 82; do
for ext in bcmath fileinfo gd intl mbstring nd_pdo_mysql soap xmlreader xmlwriter zip; do
ln -sf /opt/alt/php$v/etc/php.d.std/$ext.ini /opt/alt/php$v/etc/php.d/$ext.ini
done
done
This enables:
bcmath
fileinfo
gd
intl
mbstring
pdo_mysql
soap
xmlreader
xmlwriter
zip
5. Enable PDO
pdo_mysql depends on PDO itself.
On a fresh installation, pdo.so may exist while pdo.ini is not linked into the active configuration.
Enable PDO:
for v in 72 74 82; do
ln -s /opt/alt/php$v/etc/php.d.std/pdo.ini /opt/alt/php$v/etc/php.d/pdo.ini
done
Verify:
for v in 72 74 82; do
echo "===== PHP $v ====="
/opt/alt/php$v/usr/bin/php -m | grep -Ei 'PDO|pdo_mysql'
done
Expected result:
PDO
pdo_mysql
for each PHP version.
6. Enable DOM for XMLReader
XMLReader depends on the DOM extension.
The xmlreader.ini file may already be linked correctly while XMLReader still does not load because DOM is missing.
Enable DOM:
for v in 72 74 82; do
ln -s /opt/alt/php$v/etc/php.d.std/dom.ini /opt/alt/php$v/etc/php.d/dom.ini
done
Verify:
for v in 72 74 82; do
echo "===== PHP $v ====="
/opt/alt/php$v/usr/bin/php -m | grep -Ei 'dom|xmlreader'
done
You should see:
dom
xmlreader
for each version.
7. Verify the Complete Standard Extension Set
Run:
for v in 72 74 82; do
echo "===== PHP $v ====="
/opt/alt/php$v/usr/bin/php -m | grep -Ei 'bcmath|curl|dom|exif|fileinfo|gd|intl|json|mbstring|mysqli|mysqlnd|PDO|pdo_mysql|soap|xml|xmlreader|xmlwriter|zip'
echo
done
A normal hosting configuration should include most or all of the following:
bcmath
curl
dom
exif
fileinfo
gd
intl
json
mbstring
mysqli
mysqlnd
PDO
pdo_mysql
soap
xml
xmlreader
xmlwriter
zip
8. Check What Standard Configurations Are Available
To compare available extension configurations against what PHP is actually loading:
for v in 72 74 82; do
echo "===== PHP $v ====="
echo "Available standard configs:"
ls /opt/alt/php$v/etc/php.d.std/ | \
grep -Ei 'bcmath|curl|dom|exif|fileinfo|gd|imagick|intl|mbstring|mysqli|mysqlnd|pdo|soap|xml|zip'
echo
echo "Currently loaded:"
/opt/alt/php$v/usr/bin/php -m | \
grep -Ei 'bcmath|curl|dom|exif|fileinfo|gd|imagick|intl|mbstring|mysqli|mysqlnd|pdo|soap|xml|zip'
echo
done
This is one of the fastest ways to diagnose a new ALT-PHP installation.
9. Imagick May Require Separate Attention
Imagick is packaged separately:
alt-php72-pecl-imagick
alt-php74-pecl-imagick
alt-php82-pecl-imagick
Do not automatically force-install Imagick if DNF reports dependency conflicts.
For example, older EL7 packages such as:
libheif
x265-libs
can conflict with newer EL8 dependencies required by Imagick.
Do not blindly use:
--allowerasing
on a production cPanel server.
Investigate the conflicting RPMs first.
10. Important Notes
TuxCare ELS ALT-PHP is not CloudLinux PHP Selector.
Commands such as:
selectorctl
do not apply unless CloudLinux PHP Selector is separately installed.
TuxCare ALT-PHP versions are located under:
/opt/alt/phpXX/
For example:
/opt/alt/php72/
/opt/alt/php74/
/opt/alt/php82/
To check extensions for a specific version, always call that version directly:
/opt/alt/php74/usr/bin/php -m
instead of relying on the server's default:
php -m
Recommended Post-Installation Check
After adding a new TuxCare ELS PHP version to cPanel:
-
Install its standard extension RPMs.
-
Check
/opt/alt/phpXX/etc/php.d.std/. -
Check
/opt/alt/phpXX/etc/php.d/. -
Link the required extension
.inifiles intophp.d. -
Make sure PDO is enabled before
pdo_mysql. -
Make sure DOM is enabled before XMLReader.
-
Verify the final configuration with
/opt/alt/phpXX/usr/bin/php -m. -
Test a real website using that ALT-PHP version before considering the installation complete.
A TuxCare ELS PHP version being installed successfully does not necessarily mean its normal hosting extensions are enabled.