首页 > 解决方案 > PHP 8 正在运行,但 composer 依赖项需要 >=7 。我的机器已经有 PHP 8.0.3

问题描述

错误图片致命错误:Composer 在您的平台中检测到问题:您的 Composer 依赖项需要 PHP 版本 ">= 7.3.0"。您正在运行 7.1.33-25+ubuntu20.04.1+deb.sury.org+1。

标签: phpcomposer-phpvagranthomestead

解决方案


我看到你正在使用 Ubuntu 20.04 或 Mint 20.04,

您需要升级当前版本的 PHP,取决于您如何安装所有软件包(LAMP 或单独)

打开Terminal并使用以下命令:

sudo apt-get update

sudo apt install php7.3 php7.3-common php7.3-cli

之后,依赖项

sudo apt install php7.3-bcmath php7.3-bz2 php7.3-curl php7.3-gd php7.3-intl php7.3-json php7.3-mbstring php7.3-readline php7.3-xml php7.3-zip

如果你使用 Apache,你也需要安装它。

apt install libapache2-mod-php7.3

那应该可以解决您的问题,不要忘记重新启动您的 apache2 服务器

sudo service apache2 restart

推荐阅读