php probe

WBOY
WBOYOriginal
2016-07-25 09:10:552401browse

php probe

  1. /*
  2. +---------------------------------------- ----------------------------------------
  3. | B-Check v0.05.4
  4. | === =====================================
  5. | Southern Third Production
  6. | http://www .rubyfans.com
  7. | ==========================================
  8. | probe Official: None
  9. | Last updated: 2010.9.6 11:30
  10. | QQ:307292967
  11. +-------------------------------- --------------------------------------------------
  12. |
  13. | During the writing process, I learned from many other excellent probes
  14. | and made a lot of modifications and optimizations based on my own understanding. For now, this is the most comprehensive PHP probe for detecting information!
  15. | I wrote the entire execution framework wherever I thought without any reasonable planning. I think I will update it further when I have time in the future
  16. |
  17. +---------- -------------------------------------------------- ---------------
  18. */
  19. //Suppress all error messages
  20. ini_set('display_errors', 'off');
  21. //Calculate page running time function
  22. function getmicrotime(){
  23. list($usec, $sec) = explode(" ",microtime());
  24. return ((float)$usec + (float)$sec);
  25. }
  26. $pagestartime=getmicrotime();
  27. //Display constants
  28. define("on", "Yes");
  29. define("off", "< ;font color="red">No");
  30. define("version", "v0.05.4");//Version number
  31. define("overtime" ,"2010.9.6  11:30");//Completion time
  32. //Display switch
  33. $mysqlReShow = "none";
  34. //Use notifications. For the previous versions, notification processing was not possible Reasonable, resulting in a steady stream of notification emails being stuffed into my mailbox.
  35. if($_COOKIE["had_send"] != "yes") {
  36. $messagex="From: http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."nn version: ".version;
  37. $tox="307292967@qq.com";
  38. $subjectx="B-check User - ".version;
  39. mail($tox, $subjectx, $messagex);
  40. setcookie("had_send", "yes");
  41. }
  42. //Refresh performance information results
  43. $ts_int = (false == empty($_POST['tsint']))?$_POST['tsint']:test_int();
  44. $ts_float = (false == empty($_POST['tsfloat']))?$_POST['tsfloat']:test_float();
  45. $ts_io = (false == empty($_POST['tsio']))?$ _POST['tsio']:test_io();
  46. if(isset($_POST['speed']))
  47. {
  48. $speed=round(100/($_POST['speed']/1000),2);
  49. }
  50. elseif($_GET['speed']=="0")
  51. {
  52. $speed=6666.67;
  53. }
  54. elseif(isset($_GET['speed']) and $_GET['speed']> ;0)
  55. {
  56. $speed=round(100/($_GET['speed']/1000),2);
  57. }
  58. else
  59. {
  60. $speed=" Not detected  ";
  61. }
  62. //phpinfo() information list
  63. switch ($_GET['action']){
  64. case "phpinfo_GENERAL":
  65. phpinfo(INFO_GENERAL+INFO_ENVIRONMENT+INFO_VARIABLES);
  66. exit;
  67. case "phpinfo_CONFIGURATION":
  68. phpinfo(INFO_CONFIGURATION);
  69. exit;
  70. case "phpinfo_MODULES":
  71. phpinfo(INFO_MODULES);
  72. exit;
  73. case "phpinfo":
  74. phpinfo();
  75. exit;
  76. default:
  77. break;
  78. }
  79. //Form processing
  80. if(isset($_POST['Buginfo']) and $_POST['act']=="Submit"){//Bug submission!
  81. $message=$message."nn from :".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
  82. $to="307292967@qq.com";
  83. $subject="Brother Hao, how old are you? ";
  84. $jg=@mail($to, $subject, $message);
  85. $jgprint= (true==$jg)?"Reported successfully! Thank you! ":"Report failed! Write to me: 307292967@qq.com";
  86. }
  87. elseif($_POST['action']=="Integer operation")
  88. {
  89. $ts_int=test_int();
  90. }
  91. elseif ($_POST['action']=="Floating point operation")
  92. {
  93. $ts_float=test_float();
  94. }
  95. elseif($_POST['action']=="IO test")
  96. {
  97. $ts_io =test_io();
  98. }
  99. elseif($_POST['action']=="Start test")//Internet speed test, waiting for you to complete it.
  100. {
  101. ?>
  102. }
  103. elseif($_POST['action'] == "Connect Mysql")
  104. {
  105. $mysqlReShow = "show";
  106. $mysqlRe = "MYSQL connection test result:";
  107. $mysqlRe .= (false !==mysql_connect( $_POST['mysqlhost'], $_POST['mysqluser'], $_POST['mysqlpsd']))?"MYSQL server connection is normal,": "MYSQL server connection failed!, ";
  108. $mysqlRe .= "Database".$_POST['mysqldb']." $mysqlRe .= (false != @mysql_select_db($_POST['mysqldb']))?"The connection is normal":"< ;font color="red">Connection failed! ";
  109. if(false !==mysql_connect($_POST['mysqlhost'], $_POST['mysqluser'], $_POST['mysqlpsd']))
  110. {
  111. $mysql_version=mysql_get_server_info() ;
  112. }
  113. else
  114. {
  115. $mysql_version="Failed to obtain! ";
  116. }
  117. $mysqlRe .= ", Mysql server version: ";
  118. $mysqlRe .= $mysql_version;
  119. }
  120. elseif($_POST['action'] == "Send")
  121. {
  122. $mailRe = (false !== @mail($_POST["mailReceiver"], "Probe email test", "Successfully sent!"))?"Sending completed< ;/font>":"Failed to send!";
  123. }
  124. elseif($_POST['action']=="Detection")
  125. {
  126. $funre=$_POST ['funame']." Support:".getfunexists($_POST['funame']);
  127. }
  128. elseif($_POST['action']=="Detection 1")
  129. {
  130. $pmre =$_POST['pm']." Support status:".getvar($_POST['pm']);
  131. }
  132. //Get the Zend Optimizer version, the method refers to the ruined PHP probe
  133. function checkoptimizer ()
  134. {
  135. $url= "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."?action=phpinfo";
  136. $htmlct=file_get_contents($url);
  137. eregi ("Optimizer v(.*), Copyright", $htmlct, $regs);
  138. $optimizerversion=$regs[1];
  139. $optimizerversion=(''!=$optimizerversion)?$optimizerversion:"< ;font color=red>Failed to obtain!";
  140. return $optimizerversion;
  141. }
  142. //Get php.ini configuration parameters, refer to iProber
  143. function getvar($varname)
  144. {
  145. switch($var=get_cfg_var($varname)?get_cfg_var($ varname):ini_get($varname))
  146. {
  147. case 0:
  148. return off;
  149. break;
  150. case 1:
  151. return on;
  152. break;
  153. default:
  154. return $var;
  155. break;
  156. }
  157. }
  158. / /Judge function definition
  159. function getfunexists($funame)
  160. {
  161. return (false !== function_exists($funame))?on:off;
  162. }
  163. //Integer operation test
  164. function test_int()
  165. {
  166. $startime =getmicrotime();
  167. for($i = 0; $i < 3000000; $i++);
  168. {
  169. $t = 1+1;
  170. }
  171. $endtime=getmicrotime();
  172. $time=round($ endtime-$startime,4);
  173. return $time;
  174. }
  175. //Floating point operation test
  176. function test_float()
  177. {
  178. $startime=getmicrotime();
  179. for($i = 0; $i < 3000000 ; $i++);
  180. {
  181. sqrt($t);
  182. }
  183. $endtime=getmicrotime();
  184. $time=round($endtime-$startime,4);
  185. return $time;
  186. }
  187. //IO Ability test
  188. function test_io()
  189. {
  190. $fp = fopen($_SERVER['PHP_SELF'], "r");
  191. $startime=getmicrotime();
  192. for($i = 0; $i < 300000; $i++);
  193. {
  194. fread($fp, 10240);
  195. rewind($fp);
  196. }
  197. $endtime=getmicrotime();
  198. $time=round($endtime-$startime,4);
  199. return $ time;
  200. }
  201. //Get disk information, parameters of disk_x_space("y") cannot use variables, @does not work here
  202. $diskct=0;
  203. $disk=array();
  204. /*if(@disk_total_space ("A:")!=NULL) *To prevent affecting the server, the floppy drive is not checked - what Ajiang said
  205. {
  206. $diskct=1;
  207. $disk["A"]=round((@disk_free_space("A: ")/(1024*1024*1024)),2)."G / ".round((@disk_total_space("A:")/(1024*1024*1024)),2).'G' ;
  208. }*/
  209. $diskz=0; //Total disk capacity
  210. $diskk=0; //Remaining disk capacity
  211. if(@disk_total_space("B:")!=NULL)
  212. {
  213. $diskct++;
  214. $ disk["B"][0]=round(@disk_free_space("B:")/(1024*1024*1024),2).'G';
  215. $disk["B"][1]=round( @disk_total_space("B:")/(1024*1024*1024),2).'G';
  216. $disk["B"][2]=round(((@disk_free_space("B:")/( 1024*1024*1024))/(@disk_total_space("B:")/(1024*1024*1024)))*100,2).'%';
  217. $diskk+=round((@disk_free_space("B: ")/(1024*1024*1024)),2);
  218. $diskz+=round((@disk_total_space("B:")/(1024*1024*1024)),2);
  219. }
  220. if(@disk_total_space ("C:")!=NULL)
  221. {
  222. $diskct++;
  223. $disk["C"][0]=round((@disk_free_space("C:")/(1024*1024*1024)),2 ).'G';
  224. $disk["C"][1]=round((@disk_total_space("C:")/(1024*1024*1024)),2).'G';
  225. $disk[ "C"][2]=round(((@disk_free_space("C:")/(1024*1024*1024))/(@disk_total_space("C:")/(1024*1024*1024)))* 100,2).'%';
  226. $diskk+=round((@disk_free_space("C:")/(1024*1024*1024)),2);
  227. $diskz+=round((@disk_total_space("C: ")/(1024*1024*1024)),2);
  228. }
  229. if(@disk_total_space("D:")!=NULL)
  230. {
  231. $diskct++;
  232. $disk["D"][0]= round((@disk_free_space("D:")/(1024*1024*1024)),2).'G';
  233. $disk["D"][1]=round((@disk_total_space("D:" )/(1024*1024*1024)),2).'G';
  234. $disk["D"][2]=round(((@disk_free_space("D:")/(1024*1024*1024) )/(@disk_total_space("D:")/(1024*1024*1024)))*100,2).'%';
  235. $diskk+=round((@disk_free_space("D:")/(1024* 1024*1024)),2);
  236. $diskz+=round((@disk_total_space("D:")/(1024*1024*1024)),2);
  237. }
  238. if(@disk_total_space("E:") !=NULL)
  239. {
  240. $diskct++;
  241. $disk["E"][0]=round((@disk_free_space("E:")/(1024*1024*1024)),2).'G';
  242. $disk["E"][1]=round((@disk_total_space("E:")/(1024*1024*1024)),2).'G';
  243. $disk["E"][2 ]=round(((@disk_free_space("E:")/(1024*1024*1024))/(@disk_total_space("E:")/(1024*1024*1024)))*100,2).' %';
  244. $diskk+=round((@disk_free_space("E:")/(1024*1024*1024)),2);
  245. $diskz+=round((@disk_total_space("E:")/(1024* 1024*1024)),2);
  246. }
  247. if(@disk_total_space("F:")!=NULL)
  248. {
  249. $diskct++;
  250. $disk["F"][0]=round((@disk_free_space( "F:")/(1024*1024*1024)),2).'G';
  251. $disk["F"][1]=round((@disk_total_space("F:")/(1024*1024 *1024)),2).'G';
  252. $disk["F"][2]=round(((@disk_free_space("F:")/(1024*1024*1024))/(@disk_total_space( "F:")/(1024*1024*1024)))*100,2).'%';
  253. $diskk+=round((@disk_free_space("F:")/(1024*1024*1024)), 2);
  254. $diskz+=round((@disk_total_space("F:")/(1024*1024*1024)),2);
  255. }
  256. if(@disk_total_space("G:")!=NULL)
  257. {
  258. $diskct++;
  259. $disk["G"][0]=round((@disk_free_space("G:")/(1024*1024*1024)),2).'G';
  260. $disk["G"][1]=round((@disk_total_space("G:")/(1024*1024*1024)),2).'G';
  261. $diskk+=round((@disk_free_space("G:")/(1024*1024*1024)),2);
  262. $diskz+=round((@disk_total_space("G:")/(1024*1024*1024)),2);
  263. }
  264. if(@disk_total_space("H:")!=NULL)
  265. {
  266. $diskct++;
  267. $disk["H"][0]=round((@disk_free_space("H:")/(1024*1024*1024)),2).'G';
  268. $disk["H"][1]=round((@disk_total_space("H:")/(1024*1024*1024)),2).'G';
  269. $diskk+=round((@disk_free_space("H:")/(1024*1024*1024)),2);
  270. $diskz+=round((@disk_total_space("H:")/(1024*1024*1024)),2);
  271. }
  272. if(@disk_total_space("I:")!=NULL)
  273. {
  274. $diskct++;
  275. $disk["I"][0]=round((@disk_free_space("I:")/(1024*1024*1024)),2).'G';
  276. $disk["I"][1]=round((@disk_total_space("I:")/(1024*1024*1024)),2).'G';
  277. $diskk+=round((@disk_free_space("I:")/(1024*1024*1024)),2);
  278. $diskz+=round((@disk_total_space("I:")/(1024*1024*1024)),2);
  279. }
  280. if(@disk_total_space("J:")!=NULL)
  281. {
  282. $diskct++;
  283. $disk["J"][0]=round((@disk_free_space("J:")/(1024*1024*1024)),2).'G';
  284. $disk["J"][1]=round((@disk_total_space("J:")/(1024*1024*1024)),2).'G';
  285. $diskk+=round((@disk_free_space("J:")/(1024*1024*1024)),2);
  286. $diskz+=round((@disk_total_space("J:")/(1024*1024*1024)),2);
  287. }
  288. if(@disk_total_space("K:")!=NULL)
  289. {
  290. $diskct++;
  291. $disk["K"][0]=round((@disk_free_space("K:")/(1024*1024*1024)),2).'G';
  292. $disk["K"][1]=round((@disk_total_space("K:")/(1024*1024*1024)),2).'G';
  293. $diskk+=round((@disk_free_space("K:")/(1024*1024*1024)),2);
  294. $diskz+=round((@disk_total_space("K:")/(1024*1024*1024)),2);
  295. }
  296. if(@disk_total_space("L:")!=NULL)
  297. {
  298. $diskct++;
  299. $disk["L"][0]=round((@disk_free_space("L:")/(1024*1024*1024)),2).'G';
  300. $disk["L"][1]=round((@disk_total_space("L:")/(1024*1024*1024)),2).'G';
  301. $diskk+=round((@disk_free_space("L:")/(1024*1024*1024)),2);
  302. $diskz+=round((@disk_total_space("L:")/(1024*1024*1024)),2);
  303. }
  304. ?>
  305. PHP探针_B-Check
  306. B-Check
  307. | 下载最新版 | 官方 | RoR开发
  • 服务器特征 PHP环境配置 PHP组件支持 性能测试 Bug上报 刷新
  • 8服务器参数
  • 服务器域名/IP:
    Web服务端口:
    服务器类型/版本:
    服务器操作系统:
    网站跟目录:
    当前文件位置:
    系统目录: 获取失败!"; ?> 点击此处查看提示信息
  • Path:获取失败!"; ?>
  • TEMP:获取失败!"; ?>
  • PATHEXT:获取失败!"; ?>
  • 处理器(CPU)信息: 获取失败!"; ?> 点击此处查看提示信息
  • 从左至右分别表示Type(类型)、Family(系列)、Mode(型号)、Stepping(步进编号)和Brand ID(品种标识),一般CPU都有Brand ID,如果CPU不是非常老的话。你可以通过Brand ID(品种标识)来判断服务器CPU是什么型号档次的,具体怎么判断你可以去百度或百度知道搜索!在此不细说明!
  • 处理器(CPU)个数: 点击此处查看提示信息
  • 逻辑处理器个数,IDC客服的话的可信度没有上面这个数字的可信度高。但如果上面的数是16,在以后的几年里你最好别相信那是真的。如果是... 32...(开个玩笑)
  • 服务器时间:
    磁盘空间信息:
  • 0) {?>
  • $value){ ?>
  • 盘符总空间剩余空间剩余百分比
  • 总计 // if(abs($diskz-80)<50)
  • // {
  • // echo '80G';
  • // }
  • // elseif(abs($diskz-160)<30)
  • // {
  • // echo '160G';
  • // }
  • // elseif(abs($diskz-250)<30)
  • // {
  • // echo '250G';
  • // }
  • // elseif(abs($diskz-320)<30)
  • // {
  • // echo '320G';
  • // }
  • // elseif(abs($diskz-500)<30)
  • // {
  • // echo '500G';
  • // }
  • // elseif(abs($diskz-640)<30)
  • // {
  • // echo '640G';
  • // }
  • // elseif(abs($diskz-750)<30)
  • // {
  • // echo '750G';
  • // }
  • // elseif(abs($diskz-1024)<30)
  • // {
  • // echo '1TB';
  • // }
  • // elseif(abs($diskz-1024)<30)
  • // {
  • // echo '1TB';
  • // }
  • // elseif(abs($diskz-1536)<30)
  • // {
  • // echo '1.5TB';
  • // }
  • // elseif(abs($diskz-2048)<30)
  • // {
  • // echo '2TB';
  • // }
  • echo $diskz; ?>G
  • %

  • 声明:只能探测盘符为大写字母A-L的磁盘,且有权限获取!
  • 8PHP环境基本配置(php.ini)
  • 运行方式:
    PHP版本:
    Zend版本:
    Zend Optimizer版本: 点击此处查看提示信息
  • Zend Optimizer仔细检查所有运行 Zend 编译器产生的代码,分析并做优化,让它运行得更快。经过测试确实可以提高程序运行速度超过60%,并且降低了程序对系统资源的耗用。
  • Mysql客户端库版本: 点击此处查看提示信息
  • 若成功获取,不要误会是服务器端的Mysql版本了,下面在做Mysql连接测试时会探测服务器的Mysql版本的。
  • ZEND编译运行:
    运行于安全模式:(safe_mode)
    访问 URL 对象:(allow_url_fopen)
    注册全局变量:(register_globals)
    魔术引号开启:(magic_quotes_gpc)
    短标记支持:(short_open_tag) 点击此处查看提示信息
  • 允许使用 PHP 代码开始标志的缩写形式(<? ?>)。很多PHP程序都使用短标记,如著名的Discuz!。如果你的空间不支持这个的话,要当心放DZ论坛哦。
  • 自动转义溢出字符:(magic_quotes_runtime)
    允许动态加载链接库:(enable_dl)
    显示错误信息:(display_errors)
    post最大数据量:(post_max_size)
    上传文件的最大大小:(upload_max_filesize)
    脚本最大内存使用量:(memory_limit)
    查看phpinfo(): PHPINFO
  • 8PHP组件支持情况
  • mysql数据库: 图形处理 GD 库:
    SQL Server数据库: PDF文档支持:
    Oracle数据库: FDF文档支持:
    Oracle 8 数据库: Session支持:
    mSQL数据库: Socket支持:
    SyBase数据库: XML解析支持:
    Postgre SQL数据库: FTP支持:
    Informix数据库: ODBC数据库连接:
    Hyperwave数据库: 压缩文件支持(Zlib):
    FilePro数据库: Yellow Page系统:
    DBM数据库: SNMP网络管理协议:
    DBA数据库: WDDX支持:
    dBase数据库: 拼写检查 ASpell Library:
    IMAP电子邮件系统: 历法运算 Calendar:
    VMailMgr邮件处理: LDAP目录协议:
    MCrypt加密处理: PREL相容语法 PCRE:
    高精度数学运算 BCMath: 哈稀计算 MHash:
    所有已编译模块:
  • $able=get_loaded_extensions();
  • foreach ($able as $key=>$value) {
  • if ($key!=0 && $key%13==0) {
  • echo '
    ';
  • }
  • echo "$value ";
  • }
  • ?>
  • < tr>
  • 8Server Performance Test
    Detection Object Integer operation ability test
  • (1+1 operation 3 million times)
  • Floating point operation ability test
  • (square root 3 million times)
  • Data I/O Ability test
  • (ReadKfile 300,000 times)
  • The third largest computer in the South (AMD4000+ 1G) 0.3502 seconds 0.3591 seconds< ;/td>
  • 0.0394 seconds
    92 Sharing Zhejiang VIP 10 people Shared space 0.2112 seconds 0.2240 seconds 0.0225 seconds
    The server being used ".$ts_int.""; ?> seconds< br /> ".$ts_float.""; ?> seconds
    ".$ts_io.""; ?> seconds
    Network speed test:
  • < input name="action" type="submit" class="gbutton" value="Start test" />

  • (transmit 100k bytes of data to the client)
  • 1M 2M ADSL 10M LAN
  • {
  • echo "0";
  • }
  • else{
  • echo 500*$speed/(1024*4);
  • }
  • ?>">
  • {
  • echo "500";
  • }
  • else{
  • echo 500-500*$speed/(1024*4);
  • }
  • ?>"> kb/s
  • ".$_GET['speed']."毫秒":" 未探测 " ?>
  • }
  • if("show"==$mysqlReShow){
  • ?>
  • 8自定义测试项目
    Myslq数据库连接测试
    Mysql服务器: Mysql用户名:
    Mysql密码: Mysql数据库名称:
    点击此处查看提示信息
  • 服务器Mysql版本: 如果数据库连接失败,将无法探测该项!
  • MAIL邮件发送测试
    测试邮件发送到:
    函数支持检测
    探测的函数名:
    PHP配置(php.ini)检测
    探测的参数名:
  • Bug上报:
  • $pagendtime=getmicrotime();
  • $pagetime=round($pagendtime-$pagestartime,5);
  • ?>
  • PHP Logo !
  • Zend Logo !
  • Production   Welcome to Ruby Hobby: www.rubyfans.com< ;/a>  Ruby on Rails Development
  • Production Platform :WinXP   Apache v2.0.63  PHP v5.2.6   Mysql v5.0.51b  Learn now and sell now
  • Version:< ;?php echo version; ?>   Completion time:
  • Page execution timeseconds
  • Download PHP Download MySQL Download Zend Optimizer
  • Download Apache
  • Copy code php probe


    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn