Results 1 to 13 of 13
  1. #1
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66

    Supported way to have PHP 5.6 and PHP 7.1 on CentOS 7

    I just got a new server and upgraded the CentOS 7 base PHP 5.4 to 5.6 with REMI.
    I see I can also install PHP 7.1 with "yum install php71" as a second PHP version.

    Once I do this, I could add a handler for it in the Apache config, but only one PHP version could run through SUPHP correct?

    Would I just make a new php71.conf in the conf.d directory (basically like the php.conf one IW comments out)?
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

  2. #2
    Join Date
    Apr 2012
    Posts
    2,150
    Points
    23,244
    Level
    66
    Hi justec

    I hope your having a lovely Christmas

    As far as I know, you are correct

    Have a happy new year

    Many thanks

    John

  3. #3
    Join Date
    Apr 2012
    Posts
    2,150
    Points
    23,244
    Level
    66
    Hi Justec
    Sorry, I did a little googling and it looks likely suphp will run more then 1 version of php, see link.
    I have not tried it myself, and it is not for centos, but no reason to suppose it may not work, just read the bottom for suphp.c config
    Many thanks
    John
    https://www.howtoforge.com/apache2_suphp_php4_php5_p3

  4. The Following User Says Thank You to d2d4j For This Useful Post:


  5. #4
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66
    John,

    It works! I just tried this on my now old server (CentOS6) and it seems to work.

    The only issue I see here is messing with the vhost file where it says specifically not to edit ( # php: default don't edit between this and the "end php" comment below).

    I think there is a way to change the vhost template so that this gets added into new sites and on updates to the vhost file through NodeWorx. Is this right?



    1) Install PHP 7.1 as secondary PHP (with Remi it's just yum install php71)

    2) Update /etc/suphp.conf
    [handlers]
    ;Handler for php-scripts
    x-httpd-php="php:/usr/bin/php-cgi"
    x-httpd-php71="php:/usr/bin/php71-cgi" <-- Add this line

    3) Update the Vhost file

    # php: default don't edit between this and the "end php" comment below
    <IfModule mod_suphp.c>
    suPHP_Engine On
    suPHP_UserGroup justechn justechn
    AddHandler x-httpd-php .php
    suPHP_AddHandler x-httpd-php .php
    AddHandler x-httpd-php71 .php71 <-- add this line
    suPHP_AddHandler x-httpd-php71 .php71 <-- add this line
    suPHP_ConfigPath /home/siteworx/etc
    </IfModule>

    <IfModule !mod_suphp.c>
    <IfModule mod_php5.c>
    php_admin_flag engine On
    </IfModule>
    <IfModule mod_php4.c>
    php_admin_flag engine On
    </IfModule>
    </IfModule>
    # end php
    Last edited by Justec; 12-29-2016 at 03:26 PM.
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

  6. The Following User Says Thank You to Justec For This Useful Post:


  7. #5
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66
    A follow up to this would making a specific site (or directory) just run as PHP 7.1 without having to rename all the files to filename.php71

    Adding this to the .htaccess file does the trick
    AddHandler x-httpd-php71 .php

    You still need to have the "AddHandler x-httpd-php71 .php71" and "suPHP_AddHandler x-httpd-php71 .php71" in the main vhost file for the site, but this allows you to just make an entire SiteWorx account PHP 7.1 by default.
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

  8. The Following User Says Thank You to Justec For This Useful Post:


  9. #6
    Join Date
    Apr 2012
    Posts
    2,150
    Points
    23,244
    Level
    66
    Hi justec

    Many thanks, glad it appears to work and perhaps this is the way forward for multi php versions

    I believe your correct in thinking of adjusting the vhost template but I suspect this maybe overwritten on major updates to Iw

    Kudos to you

    Many thanks and hope you have a happy new year

    John

  10. The Following User Says Thank You to d2d4j For This Useful Post:


  11. #7
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66
    Here is the way to make new SiteWorx account vhost created with the php71.
    Just edit "/chroot/home/interworx/etc/vhost-base.conf"

    More Info: http://www.interworx.com/support/faq...and-directory/
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

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


  13. #8
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66
    Post from someone else on how to set this up using Litespeed web server

    http://forums.interworx.com/threads/...9490#post29490
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

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


  15. #9
    Join Date
    Apr 2014
    Posts
    40
    Points
    1,585
    Level
    16
    We did some basic testing of this configuration against 6.0.8, which is currently in the beta channel. InterWorx 6.0.8 adds per domain multiple php support. In my testing upgrading from 5.1.52 to 6.0.8 went smoothly, as did enabling multiple php and installing additional php versions.

    InterWorx reports SiteWorx accounts as using the "System PHP" and not the version of php set in the vhost, but transitioning to our multiple php solution at that point is possible. If anyone using the multiple php solution in this post would like to test our solution we'd be happy to provide demo keys!

  16. The Following User Says Thank You to IWorx-Nathan For This Useful Post:


  17. #10
    Join Date
    Apr 2012
    Posts
    2,150
    Points
    23,244
    Level
    66
    Hi Nathan

    I hope your well

    Sorry, have I missed a post to understand your post sorry

    If it helps, I updated an old IW v5 server and had to run multiPHP.pex I think it was, to make it work normally as it could not find the different versions.

    Worked lovely and man help was great

    Many thanks

    John

  18. #11
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66
    Since the new Iworx update isn't out yet and I have a client asking me to get them on PHP 7, I was trying to implement my how to guide here on my CentOS 7 server and it isn't working. Has something change in the Interworx setup that would prevent this or am I just missing something small?


    EDIT
    It works now...

    1) The .htaccess trick doesn't seem to be working, but just editing the vhost for that site to use the php71 as .php did the trick.

    2) The database wasn't loading on the wordpress site. So then I did yum install php71-php-mysqlnd. That still didn't fix it, but turns out at that point it was just a local php.ini file for that site that was breaking it.
    Last edited by Justec; 11-14-2017 at 11:55 AM.
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

  19. The Following User Says Thank You to Justec For This Useful Post:


  20. #12
    Join Date
    Apr 2012
    Posts
    2,150
    Points
    23,244
    Level
    66
    Hi Justin

    I hope your well and glad you resolved it

    We use RC which includes the addition of multiPHP and all seems well

    Many thanks

    John

  21. The Following User Says Thank You to d2d4j For This Useful Post:


  22. #13
    Join Date
    May 2004
    Location
    Miami
    Posts
    1,279
    Points
    23,139
    Level
    66
    Yeah, I was trying to put off doing this until the new Iworx update, but a client needed it to test an issue on their website.
    [ JUSTIN ]
    [ OFF unit ]
    [ WEB DESIGN / DEVELOPMENT, GRAPHIC DESIGN, OTHER STUFF
    ]

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
  •