2 different PHP versions installed, but ./build versions shows one wrong

Taro

Verified User
Joined
May 12, 2014
Messages
15
In options.conf I use the following settings:

Code:
php1_release=7.0
php1_mode=php-fpm
php2_release=5.6
php2_mode=mod_php

After running ./build update, ./build versions shows this as output:

Code:
Latest version of PHP 7.0: 7.0.1
Installed version of PHP 7.0: 7.0.1

Latest version of PHP (mod_php): 5.6.16
Installed version of PHP (mod_php): 7.0.1

PHP 5.6 (mod_php) 7.0.1 to 5.6.16 update is available.

As you can see the first PHP version is handled OK, but the second isn't. Can I fix this on my side with some setting, or is this a DA bug?
 
Hello,

That seems to be a bug in custombuild script.

And mod_php is not recommended to use with other PHP modes, so you should either use php-cgi (fastcgi, fpm, suphp) for the both versions or a single version of PHP as mod_php.
 
Thanks, I changed mod_php to php-fpm as well, so both now run the fpm version. After a new build the result is different:

Code:
Latest version of PHP 5.6: 5.6.16
Installed version of PHP 5.6: 5.6.16

Latest version of PHP 7.0: 7.0.1
Installed version of PHP 7.0: 7.0.1

Seems to work OK now! Maybe DA still needs a fix for if you use both mod_php and php-fpm.
 
In options.conf I use the following settings:

Code:
php1_release=7.0
php1_mode=php-fpm
php2_release=5.6
php2_mode=mod_php

After running ./build update, ./build versions shows this as output:

Code:
Latest version of PHP 7.0: 7.0.1
Installed version of PHP 7.0: 7.0.1

Latest version of PHP (mod_php): 5.6.16
Installed version of PHP (mod_php): 7.0.1

PHP 5.6 (mod_php) 7.0.1 to 5.6.16 update is available.

As you can see the first PHP version is handled OK, but the second isn't. Can I fix this on my side with some setting, or is this a DA bug?

Was "./build php n" executed before checking "./build versions"? If it wasn't, it's a normal behaviour, because CustomBuild checks the output of "/usr/local/bin/php -v" for the installed version.
 
I've found the issue. CustomBuild always set php1_release to have a binary in /usr/local/bin/php. If the 2nd version of PHP is installed as mod_php, it's binary is not placed in /usr/local/bin/php. I'd suggest using another PHP mode for php2 to solve the problem :)
 
Sorry for bringing back this old thread but my question is extremely related.
Is it correct to install PHP_mod as 1st PHP (for example v 7) and php-fpm for the second (v 5.6)?
Thank you!
 
And mod_php is not recommended to use with other PHP modes, so you should either use php-cgi (fastcgi, fpm, suphp) for the both versions or a single version of PHP as mod_php.

and here
https://help.directadmin.com/item.php?id=459

it stand for
The php1_mode set to php-fpm defines that 5.6 will use php-fpm. You could set php2_mode to use mod_php or suphp if you wish (or vice versa with php1_mode).

So, my question IS:

is this is wrong configuration?

Code:
php1_release=5.6
php1_mode=mod_php
php2_release=7.1
php2_mode=php-fpm

webserver=nginx_apache

apache_ver=2.4
apache_mpm=auto
mod_ruid2=yes
 
mod_php runs processes under apache user by default, unless mod_ruid2 is enabled. PHP-FPM runs PHP processes as user by itself. Having mod_ruid2 + php-fpm (or fastcgi/suphp/lsphp) is simply redundant, thus, it's not recommended :)
 
Thanks @smtalk

yes of course (I could not include ruid2 in the previous example),
let's take mod_ruid2 aside for a while and a webserver option, is the general rule of phpX_mode as previous user asked correct?

So, we can use it vice-versa as states in the help.directadmin?
 
Back
Top