Activate PHP extensions

Hi.
Is it possible to activate PHP extensions in Interworx. What sort of interface need for this? ssh or something else.

You should be able to install PHP extensions by searching for the extension with yum and installing the package related to the version of PHP you want to install it for.

As an example, with ioncube-loader you would run:

yum search ioncube-loader

And you’d see:

php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php54-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php55-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php56-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php70-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php71-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php72-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php73-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support
php74-php-ioncube-loader.x86_64 : Loader for ionCube Encoded Files with ionCube 24 support

Then install the package related to the version you are looking to install the extension for. For instance, if you want to install ioncube-loader for php7.1 run:

yum install php71-php-ioncube-loader

These extensions should be automatically enabled, but you may need to restart PHP and Apache just to be safe. This can be done in NodeWorx by going to System Service -> Web Server.

Please let me know if you have any additional questions.

Brandon

1 Like

Hi Stuart

We do have an existing feature request to create a UI tool for installing apache and php modules but its lower priority for now.

I struggled with this a bit at the beginning coming from cPanel/WHM and being a noob with yum. Now, I prefer using the command line and yum.

In case it helps someone else, here are a few things I found very helpful.

Check Installed PHP Modules

yum list installed *php*

Or, if you want to see the modules installed for a particular version, use:

yum list installed *php73*

Install Multiple Packages at Once

yum install package-one package-two package-three

Installing for the System

I had an issue installing SOAP so it would be available for a WHMCS cron job. I could see SOAP was installed for the default version of PHP (7.4):

# yum list installed *php-soap*
...
php74-php-soap.x86_64
...

which happened to be the same version of PHP the system was using, but when I checked the system php.ini (the one you see when you click the PHP Info link in Nodeworx -> Web Server), SOAP wasn’t there. What worked was to install php-soap.x86-64, rather than the version specific to PHP 7.4 using the following command:

yum install php-soap

After that, SOAP showed up in the system php.ini, and was available for cron.

Removing PHP Modules

To remove a PHP module, run the following command:

yum remove php <php-module-name-here>

or to remove multiple PHP modules:

yum remove php <php-module-name-here> <php-other-module-name-here> <php-another-module-name-here>

Restart to Make Changes Available

Finally, it’s been a while since I’ve done it, but I think if you’re running PHP-FPM, once you add a module, all you need to do is restart PHP-FPM from the Nodeworx -> Web Server UI to make them available.

Confirming a Module is Available

As noted in previous posts, you need to install required modules for each version of PHP you want them to be available for. The easiest way to do that for me is to create a PHP file with the phpinfo command in it:

phpinfo();

and upload it to a site that’s using the version of PHP you’re working with, then browse to it in order to search it for the module in question.

Version-Specific Ini Files

In case you need it, the location of the version-specific php.inis is:

/etc/opt/remi/php<version number; e.g., "74">
2 Likes

Hi

On the old forums, there was a long detailed thread over multiphp and modules.

I think the most frequent question raised is people not understanding the PHP versions so for clarity:

Centos install their PHP version on distro install (Centos 7 strangely installed PHP 5.4). This is the PHP version SSH PHP -v shows (otherwise known as system PHP). This is not installed by Interworx

System PHP php.ini is /etc/php.ini

Interworx can use multiPHP and you select the PHP versions you want to use. Installing modules is as above and very easy/quick to install using SSH. To check PHP modules, upload a info.php script into a siteworx hosting root folder and reference it in a browser

This will then tell you where php.ini is for that version - /etc/opt/remi/PHPxx (PHP72 PHP73 etc…).

One point to understand is Softaculous always looks to system PHP, and requires at least PHP7 upwards (this is nothing to do IW)

Lastly, when making any PHP changes, always restart PHP-FPM services as IW-Joseph post or if in doubt restart apache

Anyone looking for PHP 8 - just in RC by PHP and some modules are not available as yet. Might even include Ioncube loader still…

Hope that helps a little

Many thanks

John

Thanks for Help…
Regards
Stuart