Php7 Default web stack

hello,

i will be change the default php Default web stack. i have nethserver 7.6 with php 5.4 default webstack.
but i have some problems with old php handler. its possible run php7 as default ? what is the best way to change it.
i cant find any option on webgui.
best case i can controll in webgui php-version via vhost.

because i have some problems with secure and freebdx. freebdx version 14.0.13.4 and i cant reset session as example.

i have found in the old webgui 980 port the php settings over stephdl rep. its installed and i have select as default php7 but it doesnt work fine.
server header say
Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16

I think you can use php-scl from @stephdl.
For that you have to install stephdl repository first. Have a look here:

https://wiki.nethserver.org/doku.php?id=stephdl_repository

After that you can install php-scl with the commands at the following wiki-link:

https://wiki.nethserver.org/doku.php?id=php-scl&s[]=stephdl&s[]=repo

1 Like

Even with the option of php-scl, I agree there should be a new(er) base version for php in NS. I know we follow upstream on this but we also can not ignore the official php support:
https://www.php.net/supported-versions.php
php5 (all versions!) are eol since 1 jan 2019
php7.0 is also eol since 1 jan 2019
php7.1 already entered security updates only
php7.2 is out of active support and enters security updates only on dec 1st 2019

I know RH supports the eol versions that are shipped with the distro (and CentOS follows that path), but still… we encounter loads of applications that just need a newer version of php.

I guess we are just depending on RH on this… :confused:

3 Likes

I’m not a huge fan of RedHat’s methodology here, but it’s pretty common among other “stable”, server-oriented OSs (see also Debian, FreeBSD, etc.), and I do understand the logic for it. But why is it a problem, such that we’d need a newer base version? Install php-scl, set the default version to 7.2 (or whatever), and you’re good to go.

What the server headers say doesn’t matter. If you’ve set the root folder’s version as desired (see below):
image
…then that’s the version that’s running there. If you want to test, create a file there called test.php with contents of <?php phpinfo(); ?>. Browse to it, and you’ll see something like this:
image

2 Likes

FreePBX 14 works with PHP5.6, see FreePBX wiki.

Like many other applications on Nethserver, FreePBX uses php-fpm in /etc/httpd/fpbx-conf/httpd.conf, line 9.

Sorry, what do you mean with reset session?

To run fwconsole with PHP 5.6:

scl enable rh-php56 fwconsole

https://docs.nethserver.org/en/v7/freepbx.html#fwconsole

2 Likes

i have successfully switched php dealers via webgui. thx @ll

all have now a current php version. only with freepbx … i always have one and the same session in the webgui.
unfortunately i can’t log in. also the command “fwconsole unlock sessionid” returns the following error it would be an invalid session. even after a reload i always have the same session.
i have tried to install and uninstall freepbx several times. unfortunately without success.
i always see the webgui but can’t login. i think it is a chmod problem ?
here all log excerpts:

log from install:
Installing pm2…
Installing/Updating Required Libraries. This may take a while…The following messages are ONLY FOR DEBUGGING. Ignore anything that says ‘WARN’ or is just a warning
mkdir: cannot create directory ‘/var/www/html/freepbx/admin/modules/pm2/node/logs’: Permission denied
The command “runuser ‘asterisk’ -c 'cd /var/www/html/freepbx/admin/modules/pm2/node && mkdir -p /home/asterisk/.pm2 && mkdir -p /var/www/html/freepbx/admin/modules/pm2/node/logs && export HOME=”/home/asterisk" && export PM2_HOME="/home/asterisk/.pm2" && export ASTLOGDIR="/var/log/asterisk" && export ASTVARLIBDIR="/var/lib/asterisk" && export PATH="$HOME/.node/bin:$PATH" && export NODE_PATH="$HOME/.node/lib/node_modules:$NODE_PATH" && export MANPATH="$HOME/.node/share/man:$MANPATH" && npm-cache -v’" failed.

Error Output:

mkdir: cannot create directory ‘/var/www/html/freepbx/admin/modules/pm2/node/logs’: Permission denied

errors in freebdx.log
[2019-Sep-17 21:30:02] [CRITICAL] (admin/bootstrap.php:260) - Connection attmempt to AMI failed
[2019-Sep-17 21:30:02] [freepbx.INFO]: Deprecated way to add Console commands for module certman, adding console commands this way can have negative performance impacts. Please use module.xml. See: https://wiki.freepbx.org/display/FOP/Adding+fwconsole+commands [] []

error in deefault log:

Failed at step RUNTIME_DIRECTORY spawning /usr/sbin/asterisk: File exists

CODE_FILE src/core/execute.c
CODE_FUNCTION exec_spawn
CODE_LINE 2004
ERRNO 17
EXECUTABLE /usr/sbin/asterisk
MESSAGE_ID 641257651c1b4ec9a8624d7a40a9e1e7
PRIORITY 3
SYSLOG_FACILITY 3
SYSLOG_IDENTIFIER systemd
USER_UNIT asterisk.service
_BOOT_ID f579d16f536f495ba2cbb24d5fd6eb65
_CAP_EFFECTIVE 1fffffffff
_COMM (asterisk)
_GID 0
_HOSTNAME nethserver.domain.tld
_MACHINE_ID b3af0e39fe30437b95296feb9ecddea9
_PID 54641
_SOURCE_REALTIME_TIMESTAMP 1568750623354533
_SYSTEMD_CGROUP /system.slice/asterisk.service/control
_SYSTEMD_SLICE system.slice
_SYSTEMD_UNIT asterisk.service
_TRANSPORT journal
_UID 0
__CURSOR s=10fb299b5baf45bd90e2ab1734ea0659;i=8e23;b=f579d16f536f495ba2cbb24d5fd6eb65;m=38090861f;t=592c537a56f85;x=58d3c8e2143df3c1
__MONOTONIC_TIMESTAMP 15041857055
__REALTIME_TIMESTAMP 1568750623354757

You may try to set permissions with fwconsole or set permissions of /var/www/html/freepbx/admin/modules/pm2/node manually.

thx all … great forum :slight_smile: i have removed the freepbx completly and reinstalled and now it works perfect :slight_smile:
danke: Uninstall FreePBX completely

1 Like

Thanks for your feedback.
Could you please mark the topic as solved.

ok :wink: i like nethserver … and the Community :slight_smile: realy good product

3 Likes