安裝了http://www.wtbis.cn/app/view/wz_task 《簡單方便的計劃任務(wù)》如下錯誤我該怎么辦?
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 . . .
你這個報錯是因為你在這里 D:\phpstudy_pro\WWW\2\fengu\plugin\tuCrontabs\config\app.php(12): env()
使用Env::get()獲取配置,但是你又沒有安裝相關(guān)的包導致的。
查看Illuminate\Support
目錄下的composer.json
,會發(fā)現(xiàn)suggest
節(jié)點:
"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)."
},
猜測它讀取env配置文件推薦的是vlucas/phpdotenv
這個包。
嘗試在根目錄執(zhí)行 composer require vlucas/phpdotenv
然后再啟動試試。
如果還報 Uncaught Error: Class "PhpOption\Option" not found
, 那就再安裝phpoption這個包 composer require phpoption/phpoption