From cb152de425a137787689115407fa34fcbbbcc1fb Mon Sep 17 00:00:00 2001 From: yin <1830959054@qq.com> Date: Tue, 10 Feb 2026 10:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcli=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=BA=A7=E7=94=9F=E6=97=A5=E5=BF=97=E5=AF=BC=E8=87=B4web?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=86=99?= =?UTF-8?q?=E5=85=A5=E6=97=A5=E5=BF=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/log/driver/File.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/think/log/driver/File.php b/library/think/log/driver/File.php index bace4c2f..098d485f 100644 --- a/library/think/log/driver/File.php +++ b/library/think/log/driver/File.php @@ -49,7 +49,11 @@ class File $destination = $this->getMasterLogFile(); $path = dirname($destination); - !is_dir($path) && mkdir($path, 0755, true); + if (PHP_SAPI != 'cli') { + !is_dir($path) && mkdir($path, 0755, true); + } else { + !is_dir($path) && mkdir($path, 0777, true) && chmod($path, 0777); + } $info = []; foreach ($log as $type => $val) { -- Gitee