What is the correct way to change PHP version to newer version?

NethServer release 7.9.2009 (final)
-Running Stephdl Repository

When I do php - v I get the following…

[root@cvserver bin]# php -v

PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

What is the proper way in NetherServer terminal or console to change PHP from version 5.4.16. to version 7.x when you are running Stephdl Repository?


Stephdl repository or no, you can change it on a per-virtualhost basis in the virtual host config pages.

1 Like

I took a couple of pictures to help you see. I am unable to change PHP via old server manager or new server manager for Nethserver.

I have Stephdl repository loaded -

I am unable to change the default PHP in virtual host.

Any thoughts?


I don’t believe there’s a way to do that. There was under the old, deprecated php-scl module from @stephdl, but I don’t believe there’s currently a way.

Indeed nethserver-php-scl has been deprecated because nethgui is deprected. Actually it is not possible to change the defaut php virtualhost like this

The easy way is to not use the default virtualhost and create a specific virtualhost for your need

…which is pretty unfortunate, as that was possible under your module.

But that doesn’t work too well if you want the content in question served at the domain root.

If really really really needed then it is possible with a custom template.

For ns8 it is not possible nothing is running without a real virtualhost, however when you want a php version we start a container for that. It makes me think that we should add php8.2

1 Like

I never really thanked @danb35 and @stephdl for actually trying to help me. I appreciate your thoughts on this one. I wish there was a direct solutions for this issue, and if it was in @stephdl module, I would have thought it would have been good to keep that availability. I guess there was a reason not to.

Just out of curiosity, what is the custom template way?