安装《简单方便的计划任务》的错误

siwei

问题描述

安装了https://www.workerman.net/app/view/wz_task 《简单方便的计划任务》如下错误我该怎么办?

报错信息

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 . . .

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

截图

147 2 0
2个回答

wuheng

用 composer 把 PhpOption\Option 安装上。

  • 暂无评论
chao

你这个报错是因为你在这里 D:\phpstudy_pro\WWW\2\fengu\plugin\tuCrontabs\config\app.php(12): env() 使用Env::get()获取配置,但是你又没有安装相关的包导致的。
查看Illuminate\Support目录下的composer.json,会发现suggest节点:

"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这个包。
尝试在根目录执行 composer require vlucas/phpdotenv
然后再启动试试。

如果还报 Uncaught Error: Class "PhpOption\Option" not found, 那就再安装phpoption这个包 composer require phpoption/phpoption

  • 暂无评论
×
🔝