【问题标题】:Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale)Symfony\Component\Translation\TranslatorInterface::setLocale($locale) 的声明
【发布时间】:2020-02-04 08:19:52
【问题描述】:

我在 CPanel 上上传了一个 laravel 项目,我得到了这个错误

声明 Symfony\Component\Translation\TranslatorInterface::setLocale($locale) 必须与 Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) 兼容

该项目在本地主机上运行良好,我的问题出在 CPanel 中。

我的 laravel 项目的版本是 5.8.36

【问题讨论】:

    标签: cpanel


    【解决方案1】:

    看起来您运行 composer update 时使用的 PHP 版本与用于执行应用程序的版本不同。

    解决办法如下:-

    Symfony/translation-contracts/composer.json编辑

    "require": {
            "php": "^7.2.9"
    },
    

    "require": {
            "php": "^7.1.3"
    },
    

    然后在运行 composer update 之后将symfony/translation-contracts: "^1.1.6" 添加到project/composer.json 它应该可以工作:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-18
      • 2021-11-20
      • 2014-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多