Files
Leantime/.dev/remote-deploy/13_debug_on.sh

23 lines
720 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e
APP_DIR=/var/www/onebot
# 打开 debug让 Laravel 直接渲染真实错误
sed -i 's/^APP_DEBUG=.*/APP_DEBUG=true/' "$APP_DIR/.env"
sed -i 's/^LEAN_DEBUG=.*/LEAN_DEBUG=1/' "$APP_DIR/.env"
grep -E "APP_DEBUG|LEAN_DEBUG" "$APP_DIR/.env"
# 清空旧日志,重新请求
rm -f "$APP_DIR/storage/logs/laravel.log"
echo "=== 直接 curl 看错误 ==="
curl -s http://127.0.0.1:8081/ | grep -oE "(Fatal error|Parse error|Exception|Error|message)[^<]*" | head -20
echo ""
echo "=== php-fpm 错误日志 ==="
tail -30 /var/log/php8.3-fpm.log 2>/dev/null || echo "无 php-fpm.log"
echo ""
echo "=== laravel.log ==="
tail -40 "$APP_DIR/storage/logs/laravel.log" 2>/dev/null || echo "仍无 laravel.log"