How to change PHP version for a user on CentOS Linux Server through command line?

How to change PHP version for a user on CentOS Linux Server through command line?

Today we will learn to change PHP version using PHP selector through command line. Earlier we have cl-selector tool in use on Linux but now it is depreciated and replaced with selectorctl. It is available with CageFS 5.1.3 version and above.

First of all we have to check the current version of the particular user we are dealing with through this command:
[QUOTE]# selectorctl --user-current --user=username[/QUOTE]
1.png

If you want to check the native version too then runthis command:
# selectorctl --user-current --user=username --show-native-version
2.png

Now, to set specified version to the user we have to run this command:
Eg: we have set PHP version 5.6 in this example.
# selectorctl --set-user-current=5.6 --user=username
Author
bhawanisingh
Views
3,119
First release
Last update
Rating
0.00 star(s) 0 ratings
Top