Question
I installed a new extension for a TuxCare ELS PHP (alt-php) version. How do I enable it?
How can I disable an extension?
Answer
All extensions are disabled by default for TuxCare ELS PHP (shown as "PHP ELS" in WHM), and there is no interface in cPanel to manage them. You can enable all installed extensions at once, or enable and disable them individually.
Note: If you have a CloudLinux license, you can switch extensions with PHP Selector instead.
- Log into the server via SSH.
-
Create the
/opt/alt/php-standalonefile:# touch /opt/alt/php-standalone
After the file exists, the extension configuration files in
/opt/alt/phpXX/etc/php.d.stdare loaded in the same way as the files in/opt/alt/phpXX/etc/php.d. "XX" needs to be replaced with the PHP version.Note: The
php.d.stddirectory does not replacephp.d. Both directories are read together. The/opt/alt/php-standalonefile is not created by default, so that existing custom configurations inphp.dare not affected by updates.
Note: These steps apply only when the /opt/alt/php-standalone file does not exist.
Option 1: Edit the default.ini file. If the file is empty, use Option 2 instead.
-
Create a backup copy of the file. "XX" will need to be replaced with the PHP version:
# cp -a /opt/alt/phpXX/etc/php.d/default.ini /opt/alt/phpXX/etc/php.d/default.ini.bak
- Open the /opt/alt/phpXX/etc/php.d/default.ini file with your preferred text editor.
- Remove the ";" in front of the desired extension. If the extension line is missing, add it:
extension=extension_name.so - Save the file
Option 2: Copy the configuration file for the extension into the php.d directory. Replace "XX" with the PHP version and "extension" with the name of the extension:
# cp -pv /opt/alt/phpXX/etc/php.d.all/extension.ini /opt/alt/phpXX/etc/php.d/
Note: If the same extension is loaded by more than one .ini file in the /opt/alt/phpXX/etc/php.d directory, warnings may appear in the PHP logs.
Note: These steps apply only when the /opt/alt/php-standalone file does not exist.
Option 1: Edit the default.ini file.
-
Create a backup copy of the file. "XX" will need to be replaced with the PHP version:
# cp -a /opt/alt/phpXX/etc/php.d/default.ini /opt/alt/phpXX/etc/php.d/default.ini.bak
- Open the /opt/alt/phpXX/etc/php.d/default.ini file with your preferred text editor.
- Add a ";" in front of the extension you want to disable.
- Save the file
Option 2: Remove the configuration file for the extension from the php.d directory. Replace "XX" with the PHP version and "extension" with the name of the extension:
# rm /opt/alt/phpXX/etc/php.d/extension.ini
Comments
0 comments
Article is closed for comments.