【随笔】Laravel跳坑实录

简介

虽不是phper,但在php上也越走越远,laravel优雅的开发模式下也相对提高了入门门槛

记录自己扒拉laravel项目上遇到的各种坑

大佬就别看了

干货

Auth guard driver [web] is not defined

授权驱动问题,检查config/auth.php文件中guards配置项

'web' => array(
            'driver' => 'session',
            'provider' => 'users'
),

Class DatabaseSeeder does not exist

进行数据库迁移时出现此异常,排查发现composer配置未加载classmap

检查composer文件autoload配置项

"autoload": {
    "classmap": [
      "database"
    ]
}

使用QueryList爬取文章

RT在使用QueryList的插件Phantomjs的时候遇到了一些小问题

惯例使用composer require jaeger/querylist-phantomjs来进行安装

然后收获如下异常信息

不难看出应该是phantomjs的依赖包跟laravel冲突了(这里我使用的laravel版本是5.6,后面测试了6.0依旧不行)

处理方案不多,基本上是要等待phantomjs作者来更新包引用才能解决了

symfony/dependency-injection 3.4.x-dev conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0-BETA1 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0-BETA2 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0-BETA3 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0-BETA4 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0-RC1 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.0-RC2 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.1 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.10 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.11 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.12 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.13 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.14 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.15 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.16 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.17 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.18 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.19 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.2 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.20 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.21 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.22 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.23 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.3 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.4 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.5 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.6 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.7 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.8 conflicts with symfony/http-kernel[v4.2.4].
symfony/dependency-injection v3.4.9 conflicts with symfony/http-kernel[v4.2.4].
Installation request for symfony/http-kernel (locked at v4.2.4) -> satisfiable by symfony/http-kernel[v4.2.4].

这里给出一些临时的解决方案:

1、自己建一个composer库并更改依赖版本,这里可以使用别人建好的“horror/php-phantomjs”

2、然后把插件以扩展类的形式写在框架里

版权声明:
作者:暴打小盆友
链接:https://wandhi.com/post-1003.html
来源:玩的嗨
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>