CentOS 下使用数据迁移报错

描述

在windows中运行php artisan migrate正常,迁移到CentOs7中报错,由于刚接触这个框架,排查不出问题所在,特此请教!谢谢

报错内容

PHP Fatal error:  Declaration of Carbon\Translator::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) in /www/wwwroot/roast.iicode.top/vendor/nesbot/carbon/src/Carbon/Translator.php on line 18

   Symfony\Component\ErrorHandler\Error\FatalError 

  Declaration of Carbon\Translator::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)

  at vendor/nesbot/carbon/src/Carbon/Translator.php:18
    14| use ReflectionException;
    15| use ReflectionFunction;
    16| use Symfony\Component\Translation;
    17| 
  > 18| class Translator extends Translation\Translator
    19| {
    20|     /**
    21|      * Translator singletons for each language.
    22|      *


   Whoops\Exception\ErrorException 

  Declaration of Carbon\Translator::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)

  at vendor/nesbot/carbon/src/Carbon/Translator.php:18
    14| use ReflectionException;
    15| use ReflectionFunction;
    16| use Symfony\Component\Translation;
    17| 
  > 18| class Translator extends Translation\Translator
    19| {
    20|     /**
    21|      * Translator singletons for each language.
    22|      *

      +1 vendor frames 
  2   [internal]:0
      Whoops\Run::handleShutdown()

相关截图

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
Marrigan
最佳答案

php版本问题吧,你看看本地php版本与线上php版本是否一致。

3年前 评论
iicode (楼主) 3年前
讨论数量: 1
Marrigan

php版本问题吧,你看看本地php版本与线上php版本是否一致。

3年前 评论
iicode (楼主) 3年前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!