config_global_default.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: config_global_default.php 36362 2017-02-04 02:02:03Z nemohou $
  7. */
  8. $_config = array();
  9. // ---------------------------- CONFIG DB ----------------------------- //
  10. // ---------------------------- 数据库相关设置---------------------------- //
  11. /**
  12. * 数据库主服务器设置, 支持多组服务器设置, 当设置多组服务器时, 则会根据分布式策略使用某个服务器
  13. * @example
  14. * $_config['db']['1']['dbhost'] = 'localhost'; // 服务器地址
  15. * $_config['db']['1']['dbuser'] = 'root'; // 用户
  16. * $_config['db']['1']['dbpw'] = 'root';// 密码
  17. * $_config['db']['1']['dbcharset'] = 'gbk';// 字符集
  18. * $_config['db']['1']['pconnect'] = '0';// 是否持续连接
  19. * $_config['db']['1']['dbname'] = 'x1';// 数据库
  20. * $_config['db']['1']['tablepre'] = 'pre_';// 表名前缀
  21. *
  22. * $_config['db']['2']['dbhost'] = 'localhost';
  23. * ...
  24. *
  25. */
  26. $_config['db'][1]['dbhost'] = 'localhost';
  27. $_config['db'][1]['dbuser'] = 'root';
  28. $_config['db'][1]['dbpw'] = 'root';
  29. $_config['db'][1]['dbcharset'] = 'utf8';
  30. $_config['db'][1]['pconnect'] = 0;
  31. $_config['db'][1]['dbname'] = 'ultrax';
  32. $_config['db'][1]['tablepre'] = 'pre_';
  33. /**
  34. * 数据库从服务器设置( slave, 只读 ), 支持多组服务器设置, 当设置多组服务器时, 系统根据每次随机使用
  35. * @example
  36. * $_config['db']['1']['slave']['1']['dbhost'] = 'localhost';
  37. * $_config['db']['1']['slave']['1']['dbuser'] = 'root';
  38. * $_config['db']['1']['slave']['1']['dbpw'] = 'root';
  39. * $_config['db']['1']['slave']['1']['dbcharset'] = 'gbk';
  40. * $_config['db']['1']['slave']['1']['pconnect'] = '0';
  41. * $_config['db']['1']['slave']['1']['dbname'] = 'x1';
  42. * $_config['db']['1']['slave']['1']['tablepre'] = 'pre_';
  43. * $_config['db']['1']['slave']['1']['weight'] = '0'; //权重:数据越大权重越高
  44. *
  45. * $_config['db']['1']['slave']['2']['dbhost'] = 'localhost';
  46. * ...
  47. *
  48. */
  49. $_config['db']['1']['slave'] = array();
  50. //启用从服务器的开关
  51. $_config['db']['slave'] = false;
  52. /**
  53. * 数据库 分布部署策略设置
  54. *
  55. * @example 将 common_member 部署到第二服务器, common_session 部署在第三服务器, 则设置为
  56. * $_config['db']['map']['common_member'] = 2;
  57. * $_config['db']['map']['common_session'] = 3;
  58. *
  59. * 对于没有明确声明服务器的表, 则一律默认部署在第一服务器上
  60. *
  61. */
  62. $_config['db']['map'] = array();
  63. /**
  64. * 数据库 公共设置, 此类设置通常对针对每个部署的服务器
  65. */
  66. $_config['db']['common'] = array();
  67. /**
  68. * 禁用从数据库的数据表, 表名字之间使用逗号分割
  69. *
  70. * @example common_session, common_member 这两个表仅从主服务器读写, 不使用从服务器
  71. * $_config['db']['common']['slave_except_table'] = 'common_session, common_member';
  72. *
  73. */
  74. $_config['db']['common']['slave_except_table'] = '';
  75. /**
  76. * 内存服务器优化设置
  77. * 以下设置需要PHP扩展组件支持,其中 memcache 优先于其他设置,
  78. * 当 memcache 无法启用时,会自动开启另外的两种优化模式
  79. */
  80. //内存变量前缀, 可更改,避免同服务器中的程序引用错乱
  81. $_config['memory']['prefix'] = 'discuz_';
  82. /* reids设置, 需要PHP扩展组件支持, timeout参数的作用没有查证 */
  83. $_config['memory']['redis']['server'] = '';
  84. $_config['memory']['redis']['port'] = 6379;
  85. $_config['memory']['redis']['pconnect'] = 1;
  86. $_config['memory']['redis']['timeout'] = 0;
  87. $_config['memory']['redis']['requirepass'] = '';
  88. /**
  89. * 是否使用 Redis::SERIALIZER_IGBINARY选项,需要igbinary支持,windows下测试时请关闭,否则会出>现错误Reading from client: Connection reset by peer
  90. * 支持以下选项,默认使用PHP的serializer
  91. * [重要] 该选项已经取代原来的 $_config['memory']['redis']['igbinary'] 选项
  92. * Redis::SERIALIZER_IGBINARY =2
  93. * Redis::SERIALIZER_PHP =1
  94. * Redis::SERIALIZER_NONE =0 //则不使用serialize,即无法保存array
  95. */
  96. $_config['memory']['redis']['serializer'] = 1;
  97. $_config['memory']['memcache']['server'] = ''; // memcache 服务器地址
  98. $_config['memory']['memcache']['port'] = 11211; // memcache 服务器端口
  99. $_config['memory']['memcache']['pconnect'] = 1; // memcache 是否长久连接
  100. $_config['memory']['memcache']['timeout'] = 1; // memcache 服务器连接超时
  101. $_config['memory']['apc'] = 0; // 启动对 APC 的支持
  102. $_config['memory']['apcu'] = 0; // 启动对 APCu 的支持
  103. $_config['memory']['xcache'] = 0; // 启动对 xcache 的支持
  104. $_config['memory']['eaccelerator'] = 0; // 启动对 eaccelerator 的支持
  105. $_config['memory']['wincache'] = 0; // 启动对 wincache 的支持
  106. $_config['memory']['yac'] = 0; //启动对 YAC 的支持
  107. $_config['memory']['file']['server'] = 'data/cache/filecache'; // 启动对 File 缓存的支持
  108. // 服务器相关设置
  109. $_config['server']['id'] = 1; // 服务器编号,多webserver的时候,用于标识当前服务器的ID
  110. // 附件下载相关
  111. //
  112. // 本地文件读取模式; 模式2为最节省内存方式,但不支持多线程下载
  113. // 1=fread 2=readfile 3=fpassthru 4=fpassthru+multiple
  114. $_config['download']['readmod'] = 2;
  115. // 是否启用 X-Sendfile 功能(需要服务器支持)0=close 1=nginx 2=lighttpd 3=apache
  116. $_config['download']['xsendfile']['type'] = 0;
  117. // 启用 nginx X-sendfile 时,论坛附件目录的虚拟映射路径,请使用 / 结尾
  118. $_config['download']['xsendfile']['dir'] = '/down/';
  119. // 页面输出设置
  120. $_config['output']['charset'] = 'utf-8'; // 页面字符集
  121. $_config['output']['forceheader'] = 1; // 强制输出页面字符集,用于避免某些环境乱码
  122. $_config['output']['gzip'] = 0; // 是否采用 Gzip 压缩输出
  123. $_config['output']['tplrefresh'] = 1; // 模板自动刷新开关 0=关闭, 1=打开
  124. $_config['output']['language'] = 'zh_cn'; // 页面语言 zh_cn/zh_tw
  125. $_config['output']['staticurl'] = 'static/'; // 站点静态文件路径,“/”结尾
  126. $_config['output']['ajaxvalidate'] = 0; // 是否严格验证 Ajax 页面的真实性 0=关闭,1=打开
  127. $_config['output']['iecompatible'] = 0; // 页面 IE 兼容模式
  128. // COOKIE 设置
  129. $_config['cookie']['cookiepre'] = 'discuz_'; // COOKIE前缀
  130. $_config['cookie']['cookiedomain'] = ''; // COOKIE作用域
  131. $_config['cookie']['cookiepath'] = '/'; // COOKIE作用路径
  132. // 站点安全设置
  133. $_config['security']['authkey'] = 'asdfasfas'; // 站点加密密钥
  134. $_config['security']['urlxssdefend'] = true; // 自身 URL XSS 防御
  135. $_config['security']['attackevasive'] = 0; // CC 攻击防御 1|2|4|8
  136. $_config['security']['querysafe']['status'] = 1; // 是否开启SQL安全检测,可自动预防SQL注入攻击
  137. $_config['security']['querysafe']['dfunction'] = array('load_file','hex','substring','if','ord','char');
  138. $_config['security']['querysafe']['daction'] = array('@','intooutfile','intodumpfile','unionselect','(select', 'unionall', 'uniondistinct');
  139. $_config['security']['querysafe']['dnote'] = array('/*','*/','#','--','"');
  140. $_config['security']['querysafe']['dlikehex'] = 1;
  141. $_config['security']['querysafe']['afullnote'] = 0;
  142. $_config['admincp']['founder'] = '1'; // 站点创始人:拥有站点管理后台的最高权限,每个站点可以设置 1名或多名创始人
  143. // 可以使用uid,也可以使用用户名;多个创始人之间请使用逗号“,”分开;
  144. $_config['admincp']['forcesecques'] = 0; // 管理人员必须设置安全提问才能进入系统设置 0=否, 1=是[安全]
  145. $_config['admincp']['checkip'] = 0; // 后台管理操作是否验证管理员的 IP, 1=是[安全], 0=否。仅在管理员无法登陆后台时设置 0。
  146. $_config['admincp']['runquery'] = 0; // 是否允许后台运行 SQL 语句 1=是 0=否[安全]
  147. $_config['admincp']['dbimport'] = 1; // 是否允许后台恢复论坛数据 1=是 0=否[安全]
  148. /**
  149. * 系统远程调用功能模块
  150. */
  151. // 远程调用: 总开关 0=关 1=开
  152. $_config['remote']['on'] = 0;
  153. // 远程调用: 程序目录名. 出于安全考虑,您可以更改这个目录名, 修改完毕, 请手工修改程序的实际目录
  154. $_config['remote']['dir'] = 'remote';
  155. // 远程调用: 通信密钥. 用于客户端和本服务端的通信加密. 长度不少于 32 位
  156. // 默认值是 $_config['security']['authkey'] 的 md5, 您也可以手工指定
  157. $_config['remote']['appkey'] = md5($_config['security']['authkey']);
  158. // 远程调用: 开启外部 cron 任务. 系统内部不再执行cron, cron任务由外部程序激活
  159. $_config['remote']['cron'] = 0;
  160. // $_GET|$_POST的兼容处理,0为关闭,1为开启;开启后即可使用$_G['gp_xx'](xx为变量名,$_GET和$_POST集合的所有变量名),值为已经addslashes()处理过
  161. $_config['input']['compatible'] = 1;
  162. // Addon Setting
  163. //$_config['addonsource'] = 'xx1';
  164. //$_config['addon'] = array(
  165. // 'xx1' => array(
  166. // 'website_url' => 'http://127.0.0.1/AppCenter',
  167. // 'download_url' => 'http://127.0.0.1/AppCenter/index.php',
  168. // 'download_ip' => '',
  169. // 'check_url' => 'http://127.0.0.1/AppCenter/?ac=check&file=',
  170. // 'check_ip' => ''
  171. // )
  172. //);
  173. ?>