更新时间:2023-11-16 23:23:16
这是因为当前工作目录是您在其中调用命令的目录,而不是脚本所在的目录.
That's because your current working directory is the one you call your command at, not the one your script is located in.
使用
require __DIR__ . '/../config.php';
相反. __DIR__
是指向当前文件所在目录的const.
instead. __DIR__
is a const that points to the directory current file is located in.