<noframes id="bhrfl"><address id="bhrfl"></address>

    <address id="bhrfl"></address>

    <noframes id="bhrfl"><address id="bhrfl"><th id="bhrfl"></th></address>

    <form id="bhrfl"><th id="bhrfl"><progress id="bhrfl"></progress></th></form>

    <em id="bhrfl"><span id="bhrfl"></span></em>

    全部
    常見問題
    產品動態
    精選推薦

    CRMEB知識付費系統如何處理每月一號前端報500錯

    管理 管理 編輯 刪除

    這是runtime 的權限問題,請檢查守護進程的啟動用戶應該設置成www;
    方法一: 命令操作:
    修改目錄權限:)777 www組
    /runtime
    修改文件夾及子文件夾權限可以用命令: chmod -R 777 runtime

    永久解決方法:
    在啟動workermam時使用 sudo -u www php think workerman start —d 命令

    寶塔操作:

    兩種方法:
    1.直接系統目錄文件設置權限
    (1).找到知識付費項目目錄

    (2).點擊權限設置,設置權限為777,點擊確定

    2.命令操作
    (1).目錄切換到知識付費項目根目錄,點擊終端

    (2).打開終端后切到知識付費根目錄,輸入命令執行即可

    方法二:代碼修改
    由于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文件,前端刷新檢查。


    請登錄后查看

    ? 最后編輯于2022-11-23 11:41:31

    快捷回復
    回復
    回復
    回復({{post_count}}) {{!is_user ? '我的回復' :'全部回復'}}
    排序 默認正序 回復倒序 點贊倒序

    {{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level }}

    作者 管理員 企業

    {{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推薦': '推薦'}}
    {{item.is_suggest == 1? '取消推薦': '推薦'}}
    沙發 板凳 地板 {{item.floor}}#
    {{item.user_info.title || '暫無簡介'}}
    附件

    {{itemf.name}}

    {{item.created_at}}  {{item.ip_address}}
    打賞
    已打賞¥{{item.reward_price}}
    {{item.like_count}}
    {{item.showReply ? '取消回復' : '回復'}}
    刪除
    回復
    回復

    {{itemc.user_info.nickname}}

    {{itemc.user_name}}

    回復 {{itemc.comment_user_info.nickname}}

    附件

    {{itemf.name}}

    {{itemc.created_at}}
    打賞
    已打賞¥{{itemc.reward_price}}
    {{itemc.like_count}}
    {{itemc.showReply ? '取消回復' : '回復'}}
    刪除
    回復
    回復
    查看更多
    打賞
    已打賞¥{{reward_price}}
    2460
    {{like_count}}
    {{collect_count}}
    添加回復 ({{post_count}})

    相關推薦

    快速安全登錄

    使用微信掃碼登錄
    {{item.label}} 加精
    {{item.label}} {{item.label}} 板塊推薦 常見問題 產品動態 精選推薦 首頁頭條 首頁動態 首頁推薦
    取 消 確 定
    回復
    回復
    問題:
    問題自動獲取的帖子內容,不準確時需要手動修改. [獲取答案]
    答案:
    提交
    bug 需求 取 消 確 定
    打賞金額
    當前余額:¥{{rewardUserInfo.reward_price}}
    {{item.price}}元
    請輸入 0.1-{{reward_max_price}} 范圍內的數值
    打賞成功
    ¥{{price}}
    完成 確認打賞

    微信登錄/注冊

    切換手機號登錄

    {{ bind_phone ? '綁定手機' : '手機登錄'}}

    {{codeText}}
    切換微信登錄/注冊
    暫不綁定
    亚洲欧美字幕
    CRMEB客服

    CRMEB咨詢熱線 咨詢熱線

    400-8888-794

    微信掃碼咨詢

    CRMEB開源商城下載 源碼下載 CRMEB幫助文檔 幫助文檔
    返回頂部 返回頂部
    CRMEB客服