引入Db之后无法启动

qq7467466

问题描述

引入了DB类之后无法启动服务

程序代码

    use support\Request;
    use support\Db;

    public function index(Request $request)
    {
        $list = Db::table('fa_user')->where('id', '1')->value('username');
        return response($list);
    }

报错信息

D:\phpStudy20188\PHPTutorial\WWW\webman>php windows.php

----------------------- WORKERMAN -----------------------------
Workerman version:4.1.4          PHP version:7.2.1
------------------------ WORKERS -------------------------------
worker                        listen                              processes status
monitor                       none                                1         [ok]
webman                        http://0.0.0.0:8787                 2         [ok]
Error: Call to undefined method Illuminate\Pagination\Paginator::queryStringResolver() in D:\phpStudy20188\PHPTutorial\WWW\webman\vendor\workerman\webman-framework\src\support\bootstrap\LaravelDb.php:93
Stack trace:
#0 D:\phpStudy20188\PHPTutorial\WWW\webman\support\bootstrap.php(93): support\bootstrap\LaravelDb::start(Object(Workerman\Worker))
#1 D:\phpStudy20188\PHPTutorial\WWW\webman\support\helpers.php(439): require_once('D:\\phpStudy2018...')
#2 D:\phpStudy20188\PHPTutorial\WWW\webman\vendor\workerman\workerman\Worker.php(2454): {closure}(Object(Workerman\Worker))
#3 D:\phpStudy20188\PHPTutorial\WWW\webman\vendor\workerman\workerman\Worker.php(1453): Workerman\Worker->run()

截图报错信息里报错文件相关代码

截图

截图

操作系统及workerman/webman等框架组件版本

  "require": {
    "php": ">=7.2",
    "workerman/webman-framework": "^1.4.3",
    "monolog/monolog": "^2.0",
    "psr/container": "1.1.1",
    "illuminate/database": "^6.19",
    "illuminate/pagination": "^6.19",
    "illuminate/events": "^6.19",
    "symfony/var-dumper": "^4.4",
    "webman/think-orm": "^1.0"
  },
1000 2 0
2个回答

walkor 打赏

执行composer info,看下illuminate/pagination 实际版本

  • qq7467466 2022-10-20

    doctrine/inflector 2.0.5 PHP Doctrine Inflector is a small library that can perform string manipulati...
    illuminate/container v6.19.1 The Illuminate Container package.
    illuminate/contracts v6.19.1 The Illuminate Contracts package.
    illuminate/database v6.19.1 The Illuminate Database package.
    illuminate/events v6.19.1 The Illuminate Events package.
    illuminate/pagination v6.19.1 The Illuminate Pagination package.
    illuminate/support v6.19.1 The Illuminate Support package.
    monolog/monolog 2.8.0 Sends your logs to files, sockets, inboxes, databases and various web services
    nesbot/carbon 2.62.1 An API extension for DateTime that supports 281 different languages.
    nikic/fast-route v1.3.0 Fast request router for PHP
    psr/container 1.1.1 Common Container Interface (PHP FIG PSR-11)
    psr/log 1.1.4 Common interface for logging libraries
    psr/simple-cache 1.0.1 Common interfaces for simple caching
    symfony/polyfill-mbstring v1.26.0 Symfony polyfill for the Mbstring extension
    symfony/polyfill-php72 v1.26.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
    symfony/polyfill-php80 v1.26.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
    symfony/translation v4.4.47 Provides tools to internationalize your application
    symfony/translation-contracts v1.1.13 Generic abstractions related to translation
    symfony/var-dumper v4.4.47 Provides mechanisms for walking through any arbitrary PHP variable
    workerman/webman-framework v1.4.8 High performance HTTP Service Framework.
    workerman/workerman v4.1.4 An asynchronous event driven PHP framework for easily building fast, scalabl...

  • walkor 2022-10-20

    执行composer require workerman/webman-framework ^1.4.9

tj224589

没有装think-orm啊

composer require topthink/think-orm v2.0.54

控制器 use think\facade\Db;

  • 暂无评论
年代过于久远,无法发表回答
×
🔝