index.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016-2022 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: honor <rongyao_xu@163.com>
  8. // +----------------------------------------------------------------------
  9. // [ 应用入口文件 ]
  10. // 定义应用目录
  11. // 检测PHP环境
  12. if (version_compare(PHP_VERSION, '5.5.9', '<')) die('require PHP > 5.5.9 !');
  13. //error_reporting(E_ALL ^ E_NOTICE);//显示除去 E_NOTICE 之外的所有错误信息
  14. error_reporting(E_ERROR | E_WARNING | E_PARSE);//报告运行时错误
  15. //检测是否已安装CrmEb系统
  16. if (file_exists("./install/") && !file_exists("./install/install.lock")) {
  17. if ($_SERVER['PHP_SELF'] != '/index.php') {
  18. header("Content-type: text/html; charset=utf-8");
  19. exit("请在域名根目录下安装,如:<br/> www.xxx.com/index.php 正确 <br/> www.xxx.com/www/index.php 错误,域名后面不能圈套目录, 但项目没有根目录存放限制,可以放在任意目录,apache虚拟主机配置一下即可");
  20. }
  21. header('Location:/install/index.php');
  22. exit();
  23. }
  24. // var_dump($_REQUEST);
  25. // die();
  26. if(strpos($_REQUEST['s'],'admin') !== false){
  27. $_SERVER['HTTP_HOST']='www.jhqiwh.com';
  28. $_SERVER['SERVER_NAME']='www.jhqiwh.com';
  29. }
  30. define('APP_PATH', __DIR__ . '/../application/');
  31. //静态文件目录
  32. define('PUBILC_PATH', '/');
  33. //常量文件
  34. require __DIR__ . '/../application/constant.php';
  35. // 加载框架引导文件
  36. require __DIR__ . '/../thinkphp/start.php';