安裝了http://m.wtbis.cn/app/view/wz_task 《簡(jiǎn)單方便的計(jì)劃任務(wù)》如下錯(cuò)誤我該怎么辦?
Active code page: 65001
D:\phpstudy_pro\WWW\2\fengu>php windows.php
Fatal error: Uncaught Error: Class "PhpOption\Option" not found in D:\phpstudy_pro\WWW\2\fengu\vendor\illuminate\support\Env.php:76
Stack trace:
#0 D:\phpstudy_pro\WWW\2\fengu\vendor\illuminate\support\helpers.php(137): Illuminate\Support\Env::get()
#1 D:\phpstudy_pro\WWW\2\fengu\plugin\tuCrontabs\config\app.php(12): env()
#2 D:\phpstudy_pro\WWW\2\fengu\vendor\workerman\webman-framework\src\Config.php(207): include('...')
#3 D:\phpstudy_pro\WWW\2\fengu\vendor\workerman\webman-framework\src\Config.php(63): Webman\Config::loadFromDir()
#4 D:\phpstudy_pro\WWW\2\fengu\vendor\workerman\webman-framework\src\support\App.php(146): Webman\Config::load()
#5 D:\phpstudy_pro\WWW\2\fengu\windows.php(23): support\App::loadAllConfig()
#6 {main}
thrown in D:\phpstudy_pro\WWW\2\fengu\vendor\illuminate\support\Env.php on line 76
D:\phpstudy_pro\WWW\2\fengu>pause
Press any key to continue . . .
你這個(gè)報(bào)錯(cuò)是因?yàn)槟阍谶@里 D:\phpstudy_pro\WWW\2\fengu\plugin\tuCrontabs\config\app.php(12): env()
使用Env::get()獲取配置,但是你又沒有安裝相關(guān)的包導(dǎo)致的。
查看Illuminate\Support
目錄下的composer.json
,會(huì)發(fā)現(xiàn)suggest
節(jié)點(diǎn):
"suggest": {
"illuminate/filesystem": "Required to use the composer class (^8.0).",
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).",
"ramsey/uuid": "Required to use Str::uuid() (^4.2.2).",
"symfony/process": "Required to use the composer class (^5.4).",
"symfony/var-dumper": "Required to use the dd function (^5.4).",
"vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)."
},
猜測(cè)它讀取env配置文件推薦的是vlucas/phpdotenv
這個(gè)包。
嘗試在根目錄執(zhí)行 composer require vlucas/phpdotenv
然后再啟動(dòng)試試。
如果還報(bào) Uncaught Error: Class "PhpOption\Option" not found
, 那就再安裝phpoption這個(gè)包 composer require phpoption/phpoption