<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 每月一號前端報500錯,Linux系統 這是runtime 的權限問題,請**檢查守護進程的啟動用戶應該設置成www;** 方法一: 命令操作: 修改目錄權限:)777 www組 /runtime 修改文件夾及子文件夾權限可以用命令:? chmod -R 777 runtime 或者 在啟動workermam時使用 sudo -u www php think workerman start --d 命令 ### 寶塔操作: 1.找到知識付費項目目錄 ![](https://img.kancloud.cn/a7/27/a72795fb5a61ee744c6bd99ecdf1a3fd_3484x1702.png) 2.點擊權限設置,設置權限為777,點擊確定 ![](https://img.kancloud.cn/e0/f0/e0f03a08e459f38dd134bc99960ab289_2002x786.png) 命令操作 1.目錄切換到知識付費項目根目錄,點擊終端 ![](https://img.kancloud.cn/e0/b7/e0b7aea146558326f74fb3dcd646d801_3016x738.png) 2.打開終端后切到知識付費根目錄,輸入命令執行即可 ![](https://img.kancloud.cn/b7/9f/b79f7573c962583bec60fb2c61437a70_2818x656.png) 方法二:代碼修改 由于www用戶和root用戶(比如command的cli進程日志)都有可能對log文件進行讀寫。 如果是由www用戶創建的log文件,不會出任何問題。 但是如果是先由root用戶創建的log文件,然后再到www用戶角色去寫,就會出問題了 因為一般默認創建的log文件的權限是 -rw-r--r- 也就是www沒有權限去寫入root用戶創建的log文件。 網上的方法大體就是像下面代碼一樣在mkdir的時候修改目錄的權限 修改文件:\\thinkphp\\library\\think\\log\\driver\\File.php里的save()函數 ~~~ public function save(array $log = [], $append = false) { $destination = $this->getMasterLogFile(); $path = dirname($destination); if (PHP_SAPI != 'cli') { !is_dir($path) && mkdir($path, 0755, true); }else{ !is_dir($path) && mkdir($path, 0777, true) && chmod($path, 0777); } // !is_dir($path) && mkdir($path, 0755, true); $info = []; foreach ($log as $type => $val) { foreach ($val as $msg) { if (!is_string($msg)) { $msg = var_export($msg, true); } $info[$type][] = $this->config['json'] ? $msg : '[ ' . $type . ' ] ' . $msg; } if (!$this->config['json'] && (true === $this->config['apart_level'] || in_array($type, $this->config['apart_level']))) { // 獨立記錄的日志級別 $filename = $this->getApartLevelFile($path, $type); $this->write($info[$type], $filename, true, $append); unset($info[$type]); } } if ($info) { return $this->write($info, $destination, false, $append); } return true; } ~~~ 但是上面只能修改文件夾的權限,并沒有修改文件夾下具體的.log文件的權限。 修改文件:\\thinkphp\\library\\think\\log\\driver\\File.php里的write()函數 ~~~ protected function write($message, $destination, $apart = false, $append = false) { // 檢測日志文件大小,超過配置大小則備份日志文件重新生成 $this->checkLogSize($destination); // 日志信息封裝 $info['timestamp'] = date($this->config['time_format']); foreach ($message as $type => $msg) { $info[$type] = is_array($msg) ? implode("\r\n", $msg) : $msg; } if (PHP_SAPI == 'cli') { $message = $this->parseCliLog($info); } else { // 添加調試日志 $this->getDebugLog($info, $append, $apart); $message = $this->parseLog($info); } // return error_log($message, 3, $destination); // 解決root生成的文件,www用戶沒有寫權限的問題 by Werben 20190704 begin if (!is_file($destination)) { $first = true; } $ret = error_log($message, 3, $destination); try { if (isset($first) && is_file($destination)) { chmod($destination, 0777); unset($first); } } catch (\Exception $e) { } return $ret; } ~~~ 注:方法修改完成后,刪除runtime文件,前端刷新檢查。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看