Topic: Setting an older PHP version as default
I had several PHP 7.x installed. Now I had to install PHP 8.0. Because of this the default PHP became version 8 as well. How can I change which version is used when running the command "php"?
You are not logged in. Please login or register.
Please STOP WAR NOW! | |
![]() |
For proper configuration and installation, please use the Configuration Wizard |
Versions: PHP ≤ 8.0 is EOL - PHP 8.1.26 - PHP 8.2.13 - PHP 8.3.0
More information: #remirepo IRC channel - Twitter: @RemiRepository - Discord server
Remi's RPM repository - Forum → User support → Setting an older PHP version as default
I had several PHP 7.x installed. Now I had to install PHP 8.0. Because of this the default PHP became version 8 as well. How can I change which version is used when running the command "php"?
You can use the "scl" or "module" command to enable the version you want
$ php -v
PHP 8.0.21 (cli) (built: Jul 6 2022 10:13:53) ( NTS gcc x86_64 )
$ scl enable php72 "php --version"
PHP 7.2.34 (cli) (built: Jun 7 2022 10:31:33) ( NTS )
$ scl enable php72 bash
$ php -v
PHP 7.3.33 (cli) (built: Jun 7 2022 08:20:03) ( NTS )
$ exit
$ php -v
PHP 8.0.21 (cli) (built: Jul 6 2022 10:13:53) ( NTS gcc x86_64 )
$ module load php74
$ php -v
PHP 7.4.30 (cli) (built: Jun 7 2022 08:38:19) ( NTS )
$ module unload php74
$ php -v
PHP 8.0.21 (cli) (built: Jul 6 2022 10:13:53) ( NTS gcc x86_64 )
Also read:
https://blog.remirepo.net/post/2022/02/ … orkstation
Remi's RPM repository - Forum → User support → Setting an older PHP version as default
Generated in 0.005 seconds (58% PHP - 42% DB) with 10 queries
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 2 official extensions. Copyright © 2003–2009 PunBB.