在CentOS中切換PHP版本,常用方法有以下幾種:
sudo yum-config-manager --enable remi-php74
phpbrew install
phpbrew switch
切換后需重啟Web服務器使更改生效,可通過php -v命令驗證版本是否切換成功。
php -v