如何切换PHP-FPM版本?
2025-04-14
4
参考资料
列出已安装的PHP版本:
ls /etc/php
禁用当前PHP-FPM版本:
sudo systemctl disable php<当前版本>-fpm sudo systemctl stop php<当前版本>-fpm
启用新版本PHP-FPM:
sudo systemctl enable php<新版本>-fpm sudo systemctl start php<新版本>-fpm
更新Apache/Nginx配置(根据使用的Web服务器):
Apache:
sudo a2disconf php<当前版本>-fpm sudo a2enconf php<新版本>-fpm sudo systemctl restart apache2
Nginx:
修改站点配置中的fastcgi_pass为:fastcgi_pass unix:/run/php/php<新版本>-fpm.sock;
然后重启Nginx:
sudo systemctl restart nginx
验证切换:
php -v
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。