PHP版本降级, PHP 8.0降到7.4, 如何更改PHP版本, How to Downgrade PHP 8.0 to 7.4 Ubuntu?

PHP版本降级, PHP 8.0降到7.4, 如何更改PHP版本, How to Downgrade PHP 8.0 to 7.4 Ubuntu?
PHP版本降级, PHP 8.0降到7.4, 如何更改PHP版本, How to Downgrade PHP 8.0 to 7.4 Ubuntu?

 

介绍

如果您需要在 ubuntu 中将 PHP 8.0 降级到 7.4,那么我会告诉您在 ubuntu 中将 PHP 8.0 降级到 7.4 的命令。

您还可以在 ubuntu 中将 PHP 7.4 降级到 7.3,将 PHP 7.3 降级到 7.2,将 PHP 7.2 降级到 7.1,将 PHP 7.1 降级到 7.0。

几天前我更新了我的 ubuntu 20.04,PHP 版本从 7.4 更新到 8.0。但是,当我在 EasyEngine 上运行 PHP WordPress 项目时,EasyEngine site-type-wp 包出现了一些错误。所以我现在想现在我需要回滚 PHP 7.4 版。

 

命令

您还想回滚以安装 7.4,然后您可以运行以下命令:

// Enable PPA for PHP 7.4 in your system and install it.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
 
sudo apt-get install php7.4
sudo apt-get install php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-mbstring  php7.4-zip php7.4-fpm php7.4-intl php7.4-simplexml
 
// a2dismod disables the php8.0 module by removing those symlinks.
sudo a2dismod php8.0
 
// a2enmod enables php7.4 module within the apache2 configuration.
sudo a2enmod php7.4
 
// Restart apache2 service.
sudo service apache2 restart  
 
// Set alternative name path.
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --set phpize /usr/bin/phpize7.4
sudo update-alternatives --set php-config /usr/bin/php-config7.4

 

 

 

本文:PHP版本降级, PHP 8.0降到7.4, 如何更改PHP版本, How to Downgrade PHP 8.0 to 7.4 Ubuntu?

Loading

Add a Comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.