Problem to change PHP version

NethServer Version: 7.7
Module: PHP-CLI

I made the installation in PHP CLI I accessed the settings and changed the version of php to 7.3, but in the terminal when checking the version appears as php 5.4, I need to change to php 7.3 to run OCC commands

You’re checking incorrectly.

No you don’t; you just need to run them correctly. See here:

1 Like

Thank you, I solved and learned, I will study the documentation more.

Hi onlitec,

If you want to use php-7.3 without having to specify it every time, you can have a look at:

In my case, on the command line, I have PHP-7.2 by default:

cat > /etc/profile.d/ <<'EOT'
source /opt/remi/php72/enable
if [[ "$X_SCLS" != *php72* ]]; then
src="`scl enable php72 'echo $X_SCLS'`"
pkgs=(${src// / })
uniq=($(printf "%s\n" "${pkgs[@]}" | sort -u));
export X_SCLS="${uniq[@]}"

Make the script executable.

chmod +x /etc/profile.d/

Close the connection and login again.

Then, check the default PHP:

# which php


And its version:

# php --version

PHP 7.2.18 (cli) (built: Apr 30 2019 14:41:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies


1 Like

Great I used it this way and everything worked out, thanks for the support