Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Apr 2012
    Posts
    2,154
    Points
    23,652
    Level
    67

    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
    Attached Images Attached Images    

  2. The Following 2 Users Say Thank You to d2d4j For This Useful Post:


  3. #2
    Join Date
    Apr 2012
    Posts
    2,154
    Points
    23,652
    Level
    67
    Hi

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

    Many thanks

    John

  4. #3
    Join Date
    Sep 2013
    Posts
    5
    Points
    1,683
    Level
    16
    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

  5. The Following 2 Users Say Thank You to nightwalker For This Useful Post:


  6. #4
    Join Date
    Jun 2014
    Posts
    217
    Points
    4,123
    Level
    27
    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...worx-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:

    Code:
    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 ;-)
    Last edited by mdeinhardt; 07-12-2017 at 05:59 PM.

  7. #5
    Join Date
    Jun 2016
    Posts
    62
    Points
    1,839
    Level
    17
    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...worx-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

  8. #6
    Join Date
    Apr 2012
    Posts
    2,154
    Points
    23,652
    Level
    67
    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

  9. #7
    Join Date
    Sep 2013
    Posts
    5
    Points
    1,683
    Level
    16
    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

  10. The Following 2 Users Say Thank You to nightwalker For This Useful Post:


  11. #8
    Join Date
    Jun 2014
    Posts
    217
    Points
    4,123
    Level
    27
    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..

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

    4. I decided to install them all ;-)

    5. 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.

  12. The Following User Says Thank You to mdeinhardt For This Useful Post:


  13. #9
    Join Date
    Jun 2014
    Posts
    217
    Points
    4,123
    Level
    27
    Ha, it took me so long to write this, that nightwalker beat me to it ;-)

  14. The Following User Says Thank You to mdeinhardt For This Useful Post:


  15. #10
    Join Date
    Apr 2012
    Posts
    2,154
    Points
    23,652
    Level
    67
    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

  16. #11
    Join Date
    Jun 2014
    Posts
    217
    Points
    4,123
    Level
    27
    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

  17. The Following User Says Thank You to mdeinhardt For This Useful Post:


  18. #12
    Join Date
    Apr 2012
    Posts
    2,154
    Points
    23,652
    Level
    67
    Hi
    I feel it is important to note the following (as taken from changelog http://www.interworx.com/developers/...35-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

  19. #13
    Join Date
    Apr 2016
    Posts
    55
    Points
    1,530
    Level
    15
    Anyone know why it shows "Not Supported" on the Multiple PHP versions in the Interworx control panel. When pressing it, it tries to do something and then says can't complete the request.

  20. #14
    Join Date
    Apr 2012
    Posts
    2,154
    Points
    23,652
    Level
    67
    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

  21. #15
    Join Date
    Apr 2016
    Posts
    55
    Points
    1,530
    Level
    15
    Quote Originally Posted by d2d4j View Post
    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
    It seems updating it to the latest release candidate (we were a few updates behind) has made it possible to "Enable it". Although when I'm telling a specific site to use PHP 5.6 for example, nothing changes. A php info page still shows them on PHP 5.4?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •