这篇文章主要为大家分享了phpnow php探针环境检测代码,需要的朋友可以参考下
<?php /* YinzCN_at_Gmail.com */ error_reporting(E_ALL); define('TimeZone', +8.0); function _GET($n) { return isset($_GET[$n]) ? $_GET[$n] : NULL; } function _SERVER($n) { return isset($_SERVER[$n]) ? $_SERVER[$n] : '[undefine]'; } if (_GET('act') == 'phpinfo') { if (function_exists('phpinfo')) phpinfo(); else echo 'phpinfo() has been disabled.'; exit; } $Info = array(); $Info['php_ini_file'] = function_exists('php_ini_loaded_file') ? php_ini_loaded_file() : '[undefine]'; if (_GET('act') == 'getip') { $i = _SERVER('SERVER_NAME').'|'._SERVER('REMOTE_ADDR').'|'._SERVER('SERVER_SOFTWARE').'|'.(function_exists('mysql_close')?mysql_get_client_info():'').'|'._SERVER('DOCUMENT_ROOT'); $c = @file_get_contents('http://phpnow.org/myip.php?'.base64_encode($i)); if (preg_match('/^\d+\.\d+\.\d+\.\d+$/', $c) == 1) echo $c; else echo 'false'; exit; } function colorhost() { $c = array('#87cefa', '#ffa500', '#ff6347', '#9acd32', '#32cd32', '#ee82ee'); $a = str_split(_SERVER('SERVER_NAME')); $k = $l = 0; foreach ($a as &$d) { while ($k==$l) $k = array_rand($c); $d = ''.$d.''; $l = $k; } return implode('', $a); } function get_ea_info($name) { $ea_info = eaccelerator_info(); return $ea_info[$name]; } function get_gd_info($name) { $gd_info = gd_info(); return $gd_info[$name]; } define('YES', 'Yes'); define('NO', 'No'); ?>
Server Information | |
---|---|
SERVER_NAME | <?=_SERVER('SERVER_NAME')?> |
SERVER_ADDR:PORT | <?=_SERVER('SERVER_ADDR').':'._SERVER('SERVER_PORT')?> |
SERVER_SOFTWARE | <?=stripos(_SERVER('SERVER_SOFTWARE'), 'PHP')?_SERVER('SERVER_SOFTWARE'):_SERVER('SERVER_SOFTWARE').' PHP/'.PHP_VERSION?> |
PHP_SAPI | <?=PHP_SAPI?> |
php.ini | <?=$Info['php_ini_file']?> |
网站主目录 | <?=_SERVER('DOCUMENT_ROOT')?> |
Server Date / Time | <?=gmdate('Y-m-d', time()+TimeZone*3600)?> <?=gmdate('H:i:s', time()+TimeZone*3600)?> (<?=(TimeZone<0?'-':'+').gmdate('H:i', abs(TimeZone)*3600)?>) |
Other Links | ?act=phpinfo'>phpinfo() | <?=file_exists('phpMyAdmin') ? 'phpMyAdmin' : 'PHPnow.org'?> |
PHP 组件支持 | |
---|---|
Zend Optimizer | <?=defined('OPTIMIZER_VERSION') ? YES.' / '.OPTIMIZER_VERSION : NO?> |
MySQL 支持 | <?=function_exists('mysql_close') ? YES.' / client lib version '.mysql_get_client_info() : NO?> |
GD library | <?=function_exists('gd_info') ? YES.' / '.get_gd_info('GD Version') : NO?> |
eAccelerator | <?=function_exists('eaccelerator_info') ? YES.' / '.get_ea_info('version') : NO?> |
<?php if(isset($_POST['act'])) {?>
MySQL 测试结果 | |||
---|---|---|---|
服务器 <?=$_POST['mysqlHost']?> | <?=$str1?> | ||
数据库 <?=$_POST['mysqlDb']?> | <?=(@mysql_select_db($_POST['mysqlDb'],$link))?'OK':'Failed'?> |
Valid XHTML 1.0 Strict / Copyleft ! 2007-? by PHPnow.org
![php中文网最新课程二维码](/static/images/article_wechat2021.jpg?1111)
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论