'
. '
'
. '
还差一步:没有找到 config.php
'
. '
'
. '请复制同目录下的 config.example.php 为 config.php,'
. '填好数据库连接与 app_key 后再访问。
'
. '
';
exit;
}
$GLOBALS['config'] = require $configFile;
// ---------------- 错误报告(线上不显示错误,避免泄露路径与库信息)----------------
$debug = !empty($GLOBALS['config']['debug']);
error_reporting(E_ALL);
ini_set('display_errors', $debug ? '1' : '0');
ini_set('log_errors', '1');
// ---------------- 时区:日期是家书的核心数据,一开始就必须明确 ----------------
date_default_timezone_set($GLOBALS['config']['timezone'] ?? 'Asia/Shanghai');
// ---------------- 会话 ----------------
$isHttps = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https');
session_name('fbsid');
session_set_cookie_params([
'lifetime' => 0,
'path' => '/',
'secure' => $isHttps,
'httponly' => true,
'samesite' => 'Lax',
]);
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
require FB_APP . '/helpers.php';