在CentOS中切换PHP版本,常用方法有以下几种:
sudo yum-config-manager --enable remi-php74
phpbrew install
phpbrew switch
切换后需重启Web服务器使更改生效,可通过php -v命令验证版本是否切换成功。
php -v