Harden C2 file logging for Baota permission failures.
Swallow create_log mkdir/write errors so missing public/log ownership cannot take down requests, and document the www:www permission fix. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -446,6 +446,19 @@ tail -n 80 /www/server/php/82/var/log/php-fpm.log
|
||||
|
||||
|
||||
|
||||
### `mkdir(): Permission denied` at `Helpers.php` / `public/log`
|
||||
|
||||
C2 中间件会写 `public/log/c2/Ymd.log`。站点运行用户(宝塔多为 `www`)对 `public/log` 无写权限时会报错。
|
||||
|
||||
```bash
|
||||
cd /www/wwwroot/coruna-lab
|
||||
mkdir -p public/log/c2
|
||||
chown -R www:www public/log storage bootstrap/cache
|
||||
chmod -R ug+rwx public/log storage bootstrap/cache
|
||||
```
|
||||
|
||||
同时确认网站「运行目录 / 用户」与上述属主一致。部署后建议立刻执行一次,避免首个 C2 请求踩坑。
|
||||
|
||||
### Composer:`putenv()` undefined
|
||||
|
||||
PHP「禁用函数」含 `putenv`。在 PHP 8.2 设置里移除后重试。
|
||||
|
||||
Reference in New Issue
Block a user