php_uname(), 'PHP运行' => php_sapi_name(), '客户端IP' => $_SERVER['REMOTE_ADDR'], 'mysql版本' => mysql_get_server_info($link));//如果PHP没有禁用exec函数if(function_exists('exec')){ if(strpos(php_uname(),'mac') > -1){ $systype = 'mac'; }else{ $systype = 'linux'; } switch($systype){ case 'mac': $cpu_name = exec('sysctl -n machdep.cpu.brand_string'); $mem_usage = exec('echo $(top -l 1 | awk /PhysMem/;)'); break; case 'linux': $cpu_name = exec('cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c '); $mem_usage = exec('cat /proc/meminfo | grep Mem'); break; } $system['CPU'] = $cpu_name; $system['内存使用'] = $mem_usage; $system['开机时间'] = exec('uptime'); $system['磁盘状态'] = exec('df -lh');}$table ='';echo $table;phpinfo();?> ';foreach($system as $k=>$v){ $table .= "
";}$table.=' $k $v