PHP版本建议在".$min."及以上,当前".PHP_VERSION.""); } $pos = strpos(trim($_SERVER['SCRIPT_NAME'], '/'), '/'); if ($pos !== false && $pos > 1) { echo "本程序必须在域名根目录中安装,查看手册:https://www.xunruicms.com/doc/741.html";exit; } foreach (array(' ', '[', ']') as $t) { if (strpos(WEBPATH, $t) !== false) { exit('WEB目录'.WEBPATH.'不允许出现'.($t ? $t : '空格').'符号'); } } // 判断目录权限 foreach (array( WRITEPATH, WRITEPATH.'data/', WRITEPATH.'template/', WRITEPATH.'file/', WRITEPATH.'session/', CONFIGPATH, WEBPATH.'uploadfile/', ) as $t) { if (!dr_check_put_path($t)) { exit('目录('.$t.')不可写'); } } header('Location: index.php?c=install'); // 检查目录权限 function dr_check_put_path($dir) { if (!$dir) { return 0; } elseif (!is_dir($dir)) { return 0; } $size = @file_put_contents($dir.'test.html', 'test'); if ($size === false) { return 0; } else { @unlink($dir.'test.html'); return 1; } }