大咖們,請幫忙排錯!
https://www.bilibili.com/video/BV1Wu41117Xt/?p=3&spm_id_from=pageDriver&vd_source=3027986b738a23caaa16eaaa82e4c41b
按照這個視頻,安裝了
bootstrap.php
return [
support\bootstrap\Session::class,
support\bootstrap\ThinkOrm::class,
// support\bootstrap\LaravelDb::class,
Webman\ThinkCache\ThinkCache::class,
Webman\ThinkOrm\ThinkOrm::class,
];
===============================
IndexController.php
public function index(Request $request)
{
$art= new Article();
$list=$art->select();
dump($list)
View::assign('list',$list);
return view('index/index');
}
在控制臺 報錯如下:
------------------------ WORKERS -------------------------------
worker listen processes status
webman http://0.0.0.0:8787 4 [ok]
Warning: Class support\bootstrap\ThinkOrm setting in config/bootstrap.php not found
monitor none 1 [ok]
Warning: Class support\bootstrap\ThinkOrm setting in config/bootstrap.php not found
Workerman version:4.1.8 PHP version:8.0.2
按文檔來裝
按照手冊用composer安裝就行了
創(chuàng)建項目
composer create-project workerman/webman
進入 webman目錄執(zhí)行
composer -W require psr/container ^1.1.1 webman/think-orm webman/think-cache topthink/think-template
修改配置config/view.php為
<?php
use support\view\ThinkPHP;
return [
'handler' => ThinkPHP::class,
];
數(shù)據(jù)庫和cache 配置文件分別在 config/thinkorm.php config/thinkcache.php