=0; $l--) { $allsize1[$l]=floor($size/pow(1024,$l)); $allsize[$l]=$allsize1[$l]-$allsize1[$l+1]*1024; } $len=count($allsize); for($j = $len-1; $j >=0; $j--) { $fsize=$fsize.$allsize[$j].$danwei[$j]; } return $fsize; } function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } //检测PHP设置参数 function show($varName) { switch($result = get_cfg_var($varName)) { case 0: return '×'; break; case 1: return '√'; break; default: return $result; break; } } //保留服务器性能测试结果 $valInt = isset($_POST['pInt']) ? $_POST['pInt'] : "未测试"; $valFloat = isset($_POST['pFloat']) ? $_POST['pFloat'] : "未测试"; $valIo = isset($_POST['pIo']) ? $_POST['pIo'] : "未测试"; if ($_GET['act'] == "phpinfo") { phpinfo(); exit(); } elseif($_POST['act'] == "整型测试") { $valInt = test_int(); } elseif($_POST['act'] == "浮点测试") { $valFloat = test_float(); } elseif($_POST['act'] == "IO测试") { $valIo = test_io(); } //网速测试-开始 elseif($_POST['act']=="开始测试") { ?> "; } ?> "; Echo "这里显示系统所支持的所有函数,和自定义函数\n"; print_r($arr); echo ""; exit(); }elseif($_GET['act'] == "disable_functions") { $disFuns=get_cfg_var("disable_functions"); if(empty($disFuns)) { $arr = '×'; } else { $arr = $disFuns; } Function php() { } echo "
"; Echo "这里显示系统被禁用的函数\n"; print_r($arr); echo ""; exit(); } //MySQL检测 if ($_POST['act'] == 'MySQL检测') { $host = isset($_POST['host']) ? trim($_POST['host']) : ''; $port = isset($_POST['port']) ? (int) $_POST['port'] : ''; $login = isset($_POST['login']) ? trim($_POST['login']) : ''; $password = isset($_POST['password']) ? trim($_POST['password']) : ''; $host = preg_match('~[^a-z0-9\-\.]+~i', $host) ? '' : $host; $port = intval($port) ? intval($port) : ''; $login = preg_match('~[^a-z0-9\_\-]+~i', $login) ? '' : htmlspecialchars($login); $password = is_string($password) ? htmlspecialchars($password) : ''; } elseif ($_POST['act'] == '函数检测') { $funRe = "函数".$_POST['funName']."支持状况检测结果:".isfun1($_POST['funName']); } elseif ($_POST['act'] == '邮件检测') { $mailRe = "邮件发送检测结果:发送"; if($_SERVER['SERVER_PORT']==80){$mailContent = "http://".$_SERVER['SERVER_NAME'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} else{$mailContent = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);} $mailRe .= (false !== @mail($_POST["mailAdd"], $mailContent, "This is a test mail!")) ? "完成":"失败"; } //网络速度测试 if(isset($_POST['speed'])) { $speed=round(100/($_POST['speed']/1000),2); } elseif($_GET['speed']=="0") { $speed=6666.67; } elseif(isset($_GET['speed']) and $_GET['speed']>0) { $speed=round(100/($_GET['speed']/1000),2); //下载速度:$speed kb/s } else { $speed=" 未探测 "; } // 检测函数支持 function isfun($funName = '') { if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; return (false !== function_exists($funName)) ? '√' : '×'; } function isfun1($funName = '') { if (!$funName || trim($funName) == '' || preg_match('~[^a-z0-9\_]+~i', $funName, $tmp)) return '错误'; return (false !== function_exists($funName)) ? '√' : '×'; } //整数运算能力测试 function test_int() { $timeStart = gettimeofday(); for($i = 0; $i < 3000000; $i++) { $t = 1+1; } $timeEnd = gettimeofday(); $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; $time = round($time, 3)."秒"; return $time; } //浮点运算能力测试 function test_float() { //得到圆周率值 $t = pi(); $timeStart = gettimeofday(); for($i = 0; $i < 3000000; $i++) { //开平方 sqrt($t); } $timeEnd = gettimeofday(); $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; $time = round($time, 3)."秒"; return $time; } //IO能力测试 function test_io() { $fp = @fopen(PHPSELF, "r"); $timeStart = gettimeofday(); for($i = 0; $i < 10000; $i++) { @fread($fp, 10240); @rewind($fp); } $timeEnd = gettimeofday(); @fclose($fp); $time = ($timeEnd["usec"]-$timeStart["usec"])/1000000+$timeEnd["sec"]-$timeStart["sec"]; $time = round($time, 3)."秒"; return($time); } function GetCoreInformation() {$data = file('/proc/stat');$cores = array();foreach( $data as $line ) {if( preg_match('/^cpu[0-9]/', $line) ){$info = explode(' ', $line);$cores[]=array('user'=>$info[1],'nice'=>$info[2],'sys' => $info[3],'idle'=>$info[4],'iowait'=>$info[5],'irq' => $info[6],'softirq' => $info[7]);}}return $cores;} function GetCpuPercentages($stat1, $stat2) {if(count($stat1)!==count($stat2)){return;}$cpus=array();for( $i = 0, $l = count($stat1); $i < $l; $i++) { $dif = array(); $dif['user'] = $stat2[$i]['user'] - $stat1[$i]['user'];$dif['nice'] = $stat2[$i]['nice'] - $stat1[$i]['nice']; $dif['sys'] = $stat2[$i]['sys'] - $stat1[$i]['sys'];$dif['idle'] = $stat2[$i]['idle'] - $stat1[$i]['idle'];$dif['iowait'] = $stat2[$i]['iowait'] - $stat1[$i]['iowait'];$dif['irq'] = $stat2[$i]['irq'] - $stat1[$i]['irq'];$dif['softirq'] = $stat2[$i]['softirq'] - $stat1[$i]['softirq'];$total = array_sum($dif);$cpu = array();foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 2);$cpus['cpu' . $i] = $cpu;}return $cpus;} $stat1 = GetCoreInformation();sleep(1);$stat2 = GetCoreInformation();$data = GetCpuPercentages($stat1, $stat2); $cpu_show = $data['cpu0']['user']."%us, ".$data['cpu0']['sys']."%sy, ".$data['cpu0']['nice']."%ni, ".$data['cpu0']['idle']."%id, ".$data['cpu0']['iowait']."%wa, ".$data['cpu0']['irq']."%irq, ".$data['cpu0']['softirq']."%softirq"; function makeImageUrl($title, $data) {$api='http://api.yahei.net/tz/cpu_show.php?id=';$url.=$data['user'].',';$url.=$data['nice'].',';$url.=$data['sys'].',';$url.=$data['idle'].',';$url.=$data['iowait'];$url.='&chdl=User|Nice|Sys|Idle|Iowait&chdlp=b&chl=';$url.=$data['user'].'%25|';$url.=$data['nice'].'%25|';$url.=$data['sys'].'%25|';$url.=$data['idle'].'%25|';$url.=$data['iowait'].'%25';$url.='&chtt=Core+'.$title;return $api.base64_encode($url);} if($_GET['act'] == "cpu_percentage"){echo "
GoMirror | Yuncraft | Goat公益 | 码云 | 赞助 | 探针下载 |
---|
服务器参数 | |||
---|---|---|---|
服务器域名/IP地址 | - () 你的IP地址是: | ||
服务器标识 | |||
服务器操作系统 | 内核版本: | 服务器解译引擎 | |
服务器语言 | 服务器端口 | ||
服务器主机名 | 绝对路径 | ||
管理员邮箱 | 探针路径 |
服务器实时数据 | |||||
---|---|---|---|---|---|
服务器当前时间 | 服务器已运行时间 | ||||
CPU型号 [核] | |||||
CPU使用状况 | 查看图表";}else{echo "暂时只支持Linux系统";}?> | ||||
硬盘使用状况 | 总空间 G, 已用 G, 空闲 G, 使用率 % | ||||
内存使用状况 | 物理内存:共 , 已用 , 空闲 , 使用率 | 0) { ?> Cache化内存为 , 使用率 % | Buffers缓冲为 真实内存使用 , 真实内存空闲 , 使用率 % 0) { ?> SWAP区:共 , 已使用 , 空闲 , 使用率 %||||
系统平均负载 |
网络使用状况 | ||||
---|---|---|---|---|
: | 入网: | 实时: 0B/s | 出网: | 实时: 0B/s |
PHP已编译模块检测 | |||
---|---|---|---|
$value) {
if ($key!=0 && $key%13==0) {
echo ' '; } echo "$value "; } ?> |
PHP相关参数 | |||
---|---|---|---|
PHP信息(phpinfo): | ×' :"PHPINFO";?> | PHP版本(php_version): | |
PHP运行方式: | 脚本占用最大内存(memory_limit): | ||
PHP安全模式(safe_mode): | POST方法提交最大限制(post_max_size): | ||
上传文件最大限制(upload_max_filesize): | 浮点型数据显示的有效位数(precision): | ||
脚本超时时间(max_execution_time): | 秒 | socket超时时间(default_socket_timeout): | 秒 |
PHP页面根目录(doc_root): | 用户根目录(user_dir): | ||
dl()函数(enable_dl): | 指定包含文件目录(include_path): | ||
显示错误信息(display_errors): | 自定义全局变量(register_globals): | ||
数据反斜杠转义(magic_quotes_gpc): | "<?...?>"短标签(short_open_tag): | ||
"<% %>"ASP风格标记(asp_tags): | 忽略重复错误信息(ignore_repeated_errors): | ||
忽略重复的错误源(ignore_repeated_source): | 报告内存泄漏(report_memleaks): | ||
自动字符串转义(magic_quotes_gpc): | 外部字符串自动转义(magic_quotes_runtime): | ||
打开远程文件(allow_url_fopen): | 声明argv和argc变量(register_argc_argv): | ||
Cookie 支持: | √' : '×';?> | 拼写检查(ASpell Library): | |
高精度数学运算(BCMath): | PREL相容语法(PCRE): | ||
PDF文档支持: | SNMP网络管理协议: | ||
VMailMgr邮件处理: | Curl支持: | ||
SMTP支持: | √' : '×';?> | SMTP地址: | ×';?> |
默认支持函数(enable_functions): | 请点这里查看详细! | ||
被禁用的函数(disable_functions): |
×';
}
else
{
//echo $disFuns;
$disFuns_array = explode(',',$disFuns);
foreach ($disFuns_array as $key=>$value)
{
if ($key!=0 && $key%5==0) {
echo ' '; } echo "$value "; } } ?> |
组件支持 | |||
---|---|---|---|
FTP支持: | XML解析支持: | ||
Session支持: | Socket支持: | ||
Calendar支持 | 允许URL打开文件: | ||
GD库支持: | ×';} ?> | 压缩文件支持(Zlib): | |
IMAP电子邮件系统函数库: | 历法运算函数库: | ||
正则表达式函数库: | WDDX支持: | ||
Iconv编码转换: | mbstring: | ||
高精度数学运算: | LDAP目录协议: | ||
MCrypt加密处理: | 哈稀计算: |
第三方组件 | |||
---|---|---|---|
Zend版本 | ×';}else{echo $zend_version;}?> | 2) { echo "ZendGuardLoader[启用]"; } else { echo "Zend Optimizer"; } ?> | 2){echo (get_cfg_var("zend_loader.enable"))?'√':'×';} else{if(function_exists('zend_optimizer_version')){ echo zend_optimizer_version();}else{ echo (get_cfg_var("zend_optimizer.optimization_level")||get_cfg_var("zend_extension_manager.optimizer_ts")||get_cfg_var("zend.ze1_compatibility_mode")||get_cfg_var("zend_extension_ts"))?'√':'×';}}?> |
eAccelerator | ×";} ?> | ioncube | ×";}?> |
XCache | ×";} ?> | APC | ×";} ?> |
数据库支持 | |||
---|---|---|---|
MySQL 数据库: | ODBC 数据库: | ||
Oracle 数据库: | SQL Server 数据库: | ||
dBASE 数据库: | mSQL 数据库: | ||
SQLite 数据库: | √ ';echo "SQLite3 Ver ";echo $sqliteVer[versionString];}else {echo isfun("sqlite_close");if(isfun("sqlite_close") == '√') {echo " 版本: ".@sqlite_libversion();}}?> | Hyperwave 数据库: | |
Postgre SQL 数据库: | Informix 数据库: | ||
DBA 数据库: | DBM 数据库: | ||
FilePro 数据库: | SyBase 数据库: |
Processed in seconds. memory usage. | 返回顶部 |