The config/app.php file defines the core behavior of the ThinkPHP application. You can modify these keys to control namespaces, routing, timezones, and error handling.
Key configuration options include:
app_namespace: The application's base namespace.with_route: Boolean to enable or disable routing (true to enable).default_app: The default application name (e.g., 'index').default_timezone: The default timezone for the application (e.g., 'Asia/Shanghai').app_map: Mapping for automatic multi-application mode.domain_bind: Domain binding for automatic multi-application mode.deny_app_list: A list of applications that are prohibited from URL access.exception_tmpl: The template file path for exception pages.error_message: The error message displayed when not in debug mode.show_error_msg: Boolean to determine if error messages should be displayed (set to false for production environments).
return [
'app_namespace' => '',
'with_route' => true,
'default_app' => 'index',
'default_timezone' => 'Asia/Shanghai',
'app_map' => [],
'domain_bind' => [],
'deny_app_list' => [],
'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl',
'error_message' => '页面错误!请稍后再试~',
'show_error_msg' => false,
];