Author Topic: PHP version vs. PHP-FPm version  (Read 19346 times)

0 Members and 1 Guest are viewing this topic.

PHP version vs. PHP-FPm version
« on: January 30, 2018, 08:35:02 PM »
Apache & Varnish Cache & Nginx Reverse Proxy
CentOS 7.4.1708 (Core) - Kernel 3.10.0-693.17.1.el7.x86_64
Apache/2.4.2
nginx/1.12.2
PHP 5.6.30
PHP-FPM 5.4.16 (fpm-fcgi)
suPHP 0.7.2
Zend Engine v2.6.0 with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured)
MySQL 10.1.30-MariaDB
SEL permitting
Mod Security disabled

Nextcloud 12.0.5

I am having this weird issue with Nextcloud mistaken the PHP-FPM version as actual PHP version. After the successful installation of NC this is being presented
Quote
This version of Nextcloud requires at least PHP 5.6.0
You are currently running 5.4.16. Please update your PHP version.

Contrary to that the the output in the web browser from
Code: [Select]
?php
echo 'Current PHP version: ' . phpversion();
?>
reads
Quote
Current PHP version: 5.6.30

Is there any setting in PHP that forwards its version to NC rather than PHP-FPM reporting its own?

Re: PHP version vs. PHP-FPm version
« Reply #1 on: February 01, 2018, 01:06:28 PM »
one thing is that php-v/php-cgi -v reporting its version, e.g. 7.1, whilst php-fpm always reports its own version 5.4.16

That NC is mistaken versions seems to be a bug in NC and has been reported there

Offline
*
Re: PHP version vs. PHP-FPm version
« Reply #2 on: February 09, 2018, 01:01:45 PM »
I think you're seeing different versions because php-fpm is reading from a different php config file? try "php-fpm -i" and see what php.ini it is using.

I am having loads of issues trying to get php-fpm running on my server, and have noticed the above on my travels...

I am running PHP7.2 under a virtual host which reads from `/opt/alt/php72/usr/php/php.ini`.

However, the php-fpm service (which i think is running under `cwp-phpfpm`) reads from `/usr/local/cwp/php71/etc/php-fpm.conf` - note the different version of PHP. If you have any ideas then please let me know ;)

Re: PHP version vs. PHP-FPm version
« Reply #3 on: February 09, 2018, 01:40:06 PM »
Thanks for the feedback and the tip

currently the server this end is on PHP5.6.0 where CWP did not install the php-fpm server initally. After manually installing and starting the php-fpm server the readout is:

Quote
Server API => FPM/FastCGI
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Scan this dir for additional .ini files => /etc/php.d
Additional .ini files parsed => /etc/php.d/curl.ini,
/etc/php.d/dom.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/gd.ini,
/etc/php.d/intl.ini,
/etc/php.d/json.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/pdo.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/posix.ini,
/etc/php.d/sqlite3.ini,
/etc/php.d/sysvmsg.ini,
/etc/php.d/sysvsem.ini,
/etc/php.d/sysvshm.ini,
/etc/php.d/wddx.ini,
/etc/php.d/xmlreader.ini,
/etc/php.d/xmlwriter.ini,
/etc/php.d/xsl.ini,
/etc/php.d/zip.ini

php-fpm => active

Directive => Local Value => Master Value
cgi.discard_path => 0 => 0
cgi.fix_pathinfo => 1 => 1
cgi.force_redirect => 1 => 1
cgi.nph => 0 => 0
cgi.redirect_status_env => no value => no value
cgi.rfc2616_headers => 0 => 0
fastcgi.error_header => no value => no value
fastcgi.logging => 1 => 1
fpm.config => no value => no value

Core
PHP Version => 5.4.16


Environment
PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
_ => /usr/sbin/php-fpm

PHP Variables
Variable => Value
_SERVER["PATH"] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
_SERVER["XDG_RUNTIME_DIR"] => /run/user/0
_SERVER["_"] => /usr/sbin/php-fpm
_SERVER["PHP_SELF"] =>

So the core reports the php-fpm version but not the php/php-cgi version. Maybe that is defined somewhere in those additional ini loaded, not having had the chance yet to look into each one.

Re: PHP version vs. PHP-FPm version
« Reply #4 on: February 09, 2018, 11:44:12 PM »
just ran
Code: [Select]
rpm -qa | grep php and look where it turns out (basically everywhere) 5.4.16 as opposed to 5.6.30 (supposedly) installed on the server. Confusing the heck out of me  ???
Quote
php-composer-semver-1.4.2-1.el7.noarch
php-password-compat-1.0.4-1.el7.noarch
php-gd-5.4.16-43.el7_4.x86_64
php-symfony-console-2.8.12-2.el7.noarch
cwp-suphp-0.7.2-3.x86_64
cwp-php-5.6.30-1.x86_64
php-fedora-autoloader-1.0.0-1.el7.noarch
php-PsrLog-1.0.2-2.el7.noarch
php-symfony-filesystem-2.8.12-2.el7.noarch
php-intl-5.4.16-43.el7_4.x86_64
php-symfony-debug-2.8.12-2.el7.noarch
php-symfony-expression-language-2.8.12-2.el7.noarch
php-composer-ca-bundle-1.0.2-1.el7.noarch
php-seld-phar-utils-1.0.1-1.el7.noarch
php-composer-spdx-licenses-1.2.0-1.el7.noarch
php-paragonie-random-compat-1.4.1-1.el7.noarch
php-symfony-http-foundation-2.8.12-2.el7.noarch
php-symfony-var-dumper-2.8.12-2.el7.noarch
php-symfony-event-dispatcher-2.8.12-2.el7.noarch
php-fpm-5.4.16-43.el7_4.x86_64
php-mbstring-5.4.16-43.el7_4.x86_64
php-xml-5.4.16-43.el7_4.x86_64
php-symfony-common-2.8.12-2.el7.noarch
php-process-5.4.16-43.el7_4.x86_64
php-symfony-process-2.8.12-2.el7.noarch
php-symfony-yaml-2.8.12-2.el7.noarch
php-symfony-finder-2.8.12-2.el7.noarch
php-pdo-5.4.16-43.el7_4.x86_64
php-jsonlint-1.6.1-1.el7.noarch
php-symfony-css-selector-2.8.12-2.el7.noarch
php-symfony-browser-kit-2.8.12-2.el7.noarch
php-symfony-dependency-injection-2.8.12-2.el7.noarch
php-seld-cli-prompt-1.0.3-1.el7.noarch
php-symfony-polyfill-1.5.0-1.el7.noarch
php-symfony-http-kernel-2.8.12-2.el7.noarch
cwpphp-7.0.24-2.x86_64
php-common-5.4.16-43.el7_4.x86_64
php-symfony-class-loader-2.8.12-2.el7.noarch
php-cli-5.4.16-43.el7_4.x86_64
php-symfony-config-2.8.12-2.el7.noarch
php-justinrainbow-json-schema5-5.2.6-1.el7.noarch
php-symfony-dom-crawler-2.8.12-2.el7.noarch


« Last Edit: February 10, 2018, 12:03:20 AM by n8v8r »

Re: PHP version vs. PHP-FPm version
« Reply #5 on: February 10, 2018, 12:17:03 AM »
after
Code: [Select]
yum -y remove php-fpm
systemctl restart httpd nginx
the output from
Code: [Select]
rpm -qa | grep php remains the same and thus eliminates php-fpm as culprit apparently. To be sure there is no difference between user (space) did it as root and su

Re: PHP version vs. PHP-FPm version
« Reply #6 on: February 10, 2018, 04:03:33 AM »
RH7/COS7 apparently only support PHP 5.4.16 through their respective repos.

CWP for unbeknownst reason installed components of PHP 5.4.16 (e.g. common, cli) during the initial setup and never removed them later on, not even their PHP selector scripts. 2 PHP version, even just components, seem to to stir trouble..

As of now removing php and php-* seems to remedy the situation, removing PHP and components of current (5.4.16) flavour as supplied by the RH/COS repos