How to make ioncube available to all PHP versions

Good morning,
I am trying to make ioncube available to all new virtual servers. I have don this manually by:

Downloading ioncube and copied the correct version to its proper place:
cp ioncube_loader_lin_7.1.so /opt/rh/rh-php71/root/usr/lib64/php/modules
cp ioncube_loader_lin_7.2.so /opt/rh/rh-php72/root/usr/lib64/php/modules
cp ioncube_loader_lin_7.3.so /opt/rh/rh-php73/root/usr/lib64/php/modules

Now I update the php.ini in the virtual servers
/home/<username>/etc/ php7.x/php.ini
with:
zend_extension = /opt/rh/rh-php7x/root/usr/lib64/php/modules/ ioncube_loader_lin_7.x.so

This works and ioncube is loaded properly. However, I do not want to do this manually every time.

Is there a PHP.ini template for each version of PHP that can be edited to include the zend_extension?

I found php.ini here:

/opt/rh/rh-php7x/register.content/etc/opt/rh/rh-php7x/php.ini

I was hoping I could edit that and Virtualmin would use that as php.ini for new Virtual Servers. I tested it and that does not seem to be the case. Does anyone have any ideas how I can do this?

Thank you

You could use sed command or bash script to do that automatically for you.

Thats definitely an option. I was hoping there was a simple way to do this that maybe I was missing. So there is no php.ini template for each version?

I guess so, being said that, you know some of use use only latest php version and some of us do more versions and before it was not an issue, new version of php came out and everything and everyone did updated once the critical app they used was recoded. But one gen back old version of php vs php7 and php7. Xx is a lot to change and to be real, if you coding, php is fine on back old version from php7… so as you point out in your question, you use diff versions of php so normally you would write config for one but multiple - you would have to write more :wink:

1 Like

Also keep in mind, guys from virtualmin create code for servers and its up to user how it is willing to use it. You should ask this question on ion cube forums and perhaps you would need help to write bash script, i can help you same as many others here… My point is that this issue is not virtualmin issue. Have good day.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.