Setup and use MultiPHP, including ioncube

Hi

Kudos to Justec and Interworx for developing multi php.

To use multi PHP versions in Interworx v6.0.4, you need to first install versions of PHP

yum install php54
yum install php55
yum install php56
yum install php70
yum install php71

restart apache

to use ioncube for the different versions, you need to download the ioncube files, and extract or transfer them (using php7 as example and please change your directories to those your server uses, but take note if 32 or 64 bit, if 32 bit it is lib, lib64 for 64 bit)

first

vi /etc/opt/remi/php70/php.d/ioncube.ini

;Enable ioncube extension module
zend_extension = /opt/remi/php70/root/usr/lib64/php/modules/ioncube_loader_lin_7.0.so

save

copy ioncube_loader_lin_7.0.so to /opt/remi/php70/root/usr/lib64/php/modules

restart apache

set a siteworx account to php 7, create a phpinfo.php file, and upload to hosting root, then reference phpinfo.php to check for ioncube (see pics)

do the same for all versions of php you have installed, changing the directories as required.

The exception are as follows:

if using php5.6, you can set siteworx to system php, so it uses php5.6 already setup or you can create as above

PHP7.1, from what I have read quickly, there does not appear to be a working ioncube at this time, but guess they will be working on this. Sorry if I am wrong.

I hope that helps a little

Many thanks

John

swphpselection.png

Hi

Sorry I meant to state the permission on the .so for ioncube needs to be set to 755

Many thanks

John

If for example, you are using the REMI repo, there is an ioncube package available as well.

yum install php54-php-ioncube-loader
yum install php55-php-ioncube-loader
yum install php56-php-ioncube-loader
yum install php70-php-ioncube-loader

You can also install Zend Opache or any other module.

yum install php54-php-pecl-zendopcache.x86_64
yum install php55-php-opcache.x86_64
yum install php56-php-opcache.x86_64
yum install php70-php-opcache.x86_64

Hmm, this all seems easy enough, but I am not sure about a few things:

  1. First you have to install all the php-versions you want to use? Or are they installed when enabling multip-php (like desribed here: http://www.interworx.com/support/faq/enable-multiple-php-nodeworx-siteworx/) ? I am not 100% clear about this.
  2. How can you check, which versions are installed?
  3. When I enable multi-php according to the IW FAQ, I first got this warning: “Warning, mod_php and mod_suphp are both enabled, this is a security risk!” - Setting the PHP mode from mod_suphp to php-fpm AND a reboot helped. Not sure why simply restarting apache wasn’t enough?!?
  4. Would you rather install all ioncube versions at once, or only when needed by some software/account?
  5. I gather opcache is php-versions specific too. Usually you have to enable it in the php.ini, right?. So does that mean that I need account specific php.inis? And how would those work with php-fpm? I only know Evanions suPHP_ConfigPath way in the vhost.conf
  6. What about all the other modules? Which need to be or at least should be installed? When we had only one php version it was often something like this:
yum install php56w-mysql php56w-devel php56w-gd php56w-pecl-memcache php56w-pspell php56w-snmp php56w-xmlrpc php56w-mcrypt php56w-mailparse php56w-imap php56w-soap php56-process

I guess most (all?) of these are only used systemwide and not per account, right? What about memcache?

This whole multiPHP thing is still a bit confusing for me :wink:

Hi

So if I understand correctly if I install IW v6 on a new and clean server I cannot just make the steps described at http://www.interworx.com/support/faq/enable-multiple-php-nodeworx-siteworx/ to have multi-php?

I also must do the steps posted on this thread? If so, that not seems good. IW v6 should allow multi-php automaticly “out-of-the-box” after install.

Can someone please clear this doubt for me?

Thanks

Hi Michael and nqservices

Sorry, I do not believe IW installs additional php packages. The link states support for, so IW provide a simple means to change php.

I could be entirely wrong sorry, so apologies in advance

Also, I tried nightwalker yum install method, but it did not show as been installed for ioncube. I may not have fully understood but yum install php70 installed fine, switched to php7, info.php showed php working (no ioncube), then yum install php70-php-ioncube-loader installed, restarted apache but info.php still showed no ioncube.

I hope that helps a little

Many thanks

John

I failed to mention, that you would also need to restart each of the php-fpm instances for the version of php that is installed.

service php54-php-fpm restart
service php55-php-fpm restart
service php56-php-fpm restart
service php70-php-fpm restart

Hi John, hi nqservices,

I dug deep into multi-php and php-fpm in order to understand a little more. Here’s what I found (and please correct me, if I got anything wrong):

  1. I will verify this, as soon as I have set up another iworx machine. But I think IW installs the php packages.

  2. I bet there’s an easier way, but this is how you can check each installed php-version:
    rpm -qil php54-php-fpm
    rpm -qil php55-php-fpm
    rpm -qil php56-php-fpm
    rpm -qil php70-php-fpm
    rpm -qil php71-php-fpm

  3. There’s a few major differences between mod_php/mod_suphp and php-fpm, especially with multi-php:
    a) Each php-version has it’s own php.ini ! These can be found here (on Centos):
    /etc (for System PHP, like before)

/opt/remi/php54/root/etc

/opt/remi/php55/root/etc

/opt/remi/php56/root/etc

/etc/opt/remi/php70

/etc/opt/remi/php71
b) For any changes to the php.ini and other config files to take effect, you have to restart the corresponding php-fpm service. Restarting Apache doesn’t help at all. (that’s why I thought I had to reboot).
To restart:
systemctl restart php54-php-fpm
systemctl restart php55-php-fpm
systemctl restart php56-php-fpm
systemctl restart php70-php-fpm
systemctl restart php71-php-fpm

Or better yet, it is even enough to simply reload the config:
systemctl reload php54-php-fpm
and so on… :slight_smile:

John, this might be the reason why you had no luck with the ioncobe-loader installation via yum.

  1. I decided to install them all :wink:

  2. Answer 3 explains it already. For each php-version specific module, that needs entries in the php.ini, you simply edit the corresponding one - see 3.a) above.
    If you need individual settings per account, you can put a file .user.ini into the root of that account, like this /home/account/domain/html/.user.ini
    Then you can enter any lines you need to load, e.g.:
    max_execution_time = 300
    max_input_time = 600
    max_input_vars = 4000
    memory_limit = 256M
    post_max_size = 50M
    upload_max_filesize = 50M

Don’t forget to reload the config. To check the settings, you can use a phpinfo file as John described above.

Ha, it took me so long to write this, that nightwalker beat me to it :wink:

Hi Michael and nightwalker

Kudos to you both

Yes, silly me was restarting Apache (haha old age creeping in sorry)

Php-fpm replaces suphp, as suphp is not supported

Kudos to Michael for clear simple instructions for user.ini (not sure I like the idea of allowing total control over php per version, but guess it only allows what .htaccess could change in php)

Many thanks

John

I had some trouble with our testserver, but IW Nathan bailed my out - again!

Now I could continue my tests and I can now confirm: Enabling multi-php installs the necessary packages. So all is perfect @nqservices

Hi
I feel it is important to note the following (as taken from changelog http://www.interworx.com/developers/changelog/version-6-0-5-build-1335-2017-07-12/)
Kudos to IW
Many thanks
John
InterWorx 6.0.5 is a bug fix release focused on many small fixes to improve user experience with Multiple PHP, including significant improvements when the “system” PHP has been upgraded to a 3rd-party package. Additional improvements were made to scheduled backups, phpMyAdmin, and more.
Both php-iworx and httpd-iworx have been updated to their latest upstream versions.
NOTE: InterWorx 6.0.5 removes support for Multiple PHP on CloudLinux. The PHP packages provided by CloudLinux conflict with those provided via InterWorx. Please continue to use CloudLinux’s PHP Selector on CloudLinux.
Changed php-fpm to be default for new installs

Hi Bertie

I hope your well

I had this on a server, but struggling to remember fully sorry

It comes to mind that the server had 2 different versions of some software on it and this was stopping the change

I would open a support ticket and let IW have a quick look

If you do, please could you update your post once resolved and I?ll try to remember exactly what my issue was

Many thanks

John

Hi Bertie

Many thanks

Have you tried clearing your browser cache

What does the vhost file look like - it should have the links to the different php-fpm in I think

Have you restarted Apache

If you create a new site, does this show correct php version

If you ssh into server run php -v what version is shown

Did you correctly set the php version from nodeworx, siteworx edit site

Many thanks

John

Hi Bertie

Oh dear, that does not sound good sorry

My best advice is to open a support ticket with IW and let them have a look

Please do not try to rebuild Apache as IW use Apache from their own repo

You could look up the correct Apache version required and yum install it but honestly, I would open a support ticket as there is more going on here then first appearance

Many thanks

John

Hi
I have just seen that for PHP-FPM, there are 2 additional functions added to system services, web server which may save a little time
The first is Refresh PHP-FPM Cache - this is good because if your PHP-FPM shows cannot find, then you can run this to refresh PHP-FPM cache and should bring PHP back working
The second is Restart PHP-FPM all versions - handy if you update PHP-FPM and it does require to be restarted
Both these oprions saves time SSH into server and manually completing the actions
Kudos to Interworx
Many thanks
John

Oh, wow, that is indeed great and will come in handy! Thanks for sharing, John. Hope you are fine and enjoy your sunday!

Hi Michael

Many thanks, it?s winter here so cold and wet

Yes, interworx snook that in and I just noticed

Have you seen the CAA post - were using it

Hope your well and business is good

I?m starting to look into GDPR next week, but think your in front off me on that one. Any tips (sorry, will need to open a new thread for GDPR)

Take care and have a lovely weekend

John

Hi John,

excellent regarding CAA! Again John, thanks for sharing, without you I would regularly miss those things. Will loo into it asap.

GDPR is a horror, as it is totally unclear to most what has to be done. I have a meeting with our law firm next week to discuss the implications in detail - so, no, I am not in front on that one unfortunately :frowning:
But we had a bit more focus on privacy and data protection in the past in Germany, so I hope that gives me a headstart yet :wink:

And yes, we should definitely open a dedicated thread and throw in our experiences there.

Cheers,

Michael

I was unable to view this thread coz of my router login issue which got resolved with the help of 192.168.2.2 guide. Thanks for the info!!