有个问题问下,执行 PHP artisan migrate 报的错?

l5.1版本,执行php artisan migrate 本地服务器执行是没有问题的.阿里云上面搭建的服务器出现. `[Symfony\Component\Debug\Exception\FatalThrowableError] Type error: Return value of Doctrine\Common\Annotations\AnnotationRegistry: registerLoader() must be an instance of Doctrine\Common\Annotations\void,
none returned`

这段错误.Google过后找不到答案.求问!

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 12
leo

找找看 log 文件里这个文件的 trace,看看是哪来触发的

6年前 评论

@leo 拿到的日志如下
`2017-08-13 11:24:35] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /data/www/taopengyou/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:117
Stack trace:

0 /data/www/taopengyou/vendor/dingo/blueprint/src/Blueprint.php(70): Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(Object(Closure))

1 /data/www/taopengyou/vendor/dingo/blueprint/src/Blueprint.php(49): Dingo\Blueprint\Blueprint->registerAnnotationLoader()

2 [internal function]: Dingo\Blueprint\Blueprint->__construct(Object(Doctrine\Common\Annotations\SimpleAnnotationReader), Object(Illuminate\Filesystem\Filesystem))

3 /data/www/taopengyou/bootstrap/cache/compiled.php(1306): ReflectionClass->newInstanceArgs(Array)

4 /data/www/taopengyou/bootstrap/cache/compiled.php(1242): Illuminate\Container\Container->build('Dingo\Blueprint...', Array)

5 /data/www/taopengyou/bootstrap/cache/compiled.php(1780): Illuminate\Container\Container->make('Dingo\Blueprint...', Array)

6 /data/www/taopengyou/bootstrap/cache/compiled.php(1475): Illuminate\Foundation\Application->make('Dingo\Blueprint...')

7 /data/www/taopengyou/vendor/dingo/api/src/Provider/DingoServiceProvider.php(181): Illuminate\Container\Container->offsetGet('Dingo\Blueprint...')

8 /data/www/taopengyou/bootstrap/cache/compiled.php(1289): Dingo\Api\Provider\DingoServiceProvider->Dingo\Api\Provider{closure}(Object(Illuminate\Foundation\Application), Array)

9 /data/www/taopengyou/bootstrap/cache/compiled.php(1242): Illuminate\Container\Container->build(Object(Closure), Array)

10 /data/www/taopengyou/bootstrap/cache/compiled.php(1780): Illuminate\Container\Container->make('Dingo\Api\Conso...', Array)

11 /data/www/taopengyou/vendor/laravel/framework/src/Illuminate/Console/Application.php(115): Illuminate\Foundation\Application->make('Dingo\Api\Conso...')

12 /data/www/taopengyou/vendor/laravel/framework/src/Illuminate/Console/Application.php(129): Illuminate\Console\Application->resolve('Dingo\Api\Conso...')

13 /data/www/taopengyou/bootstrap/cache/compiled.php(5001): Illuminate\Console\Application->resolveCommands(Array)

14 [internal function]: Illuminate\Support\ServiceProvider->Illuminate\Support{closure}(Object(Illuminate\Console\Application))

15 /data/www/taopengyou/bootstrap/cache/compiled.php(9783): call_user_func_array(Object(Closure), Array)

16 /data/www/taopengyou/vendor/laravel/framework/src/Illuminate/Console/Application.php(46): Illuminate\Events\Dispatcher->fire('artisan.start', Array)

17 /data/www/taopengyou/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(225): Illuminate\Console\Application->__construct(Object(Illuminate\Foundation\Application), Object(Illuminate\Events\Dispatcher), '5.1.38 (LTS)')

18 /data/www/taopengyou/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Illuminate\Foundation\Console\Kernel->getArtisan()

19 /data/www/taopengyou/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

20 {main}`

6年前 评论

是php版本的问题吗?

6年前 评论
leo

@凡尘爵士 检查 dingo 的 blueprint 的注释,估计是哪个地方写错了

6年前 评论

@leo 已经解决.谢谢

6年前 评论

@凡尘爵士 请问如何解决,我也遇到这个问题

6年前 评论

@Calvinsily 我的是包的版本和Php的版本不兼容.

6年前 评论

@凡尘爵士 :+1: 我也是,谢谢!

6年前 评论

@凡尘爵士 请问一下是那个包和php不兼容?

5年前 评论

@Walking 看看你安装了那些包咯。那些包都有说明需求的Php版本的

5年前 评论

@凡尘爵士 我看过我项目的包都必须大于php7.0,但是我的php环境是7.1。还是不解决不了这个问题

5年前 评论

@Walking 看看错误日志咯,laravel.log里面应该有一些指示的

5年前 评论

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