把自定义变量放在 settings.php $conf['yoursite_something'] = 5; 然后在代码中获取变量值: variable_get('yoursite_something', 0);