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)?
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
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?
Install PHP 7.1 as secondary PHP (with Remi it’s just yum install php71)
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
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>
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.
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!
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.
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…
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.
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.