Heim  >  Artikel  >  Backend-Entwicklung  >  php探针 phpinfo()函数禁用时使用

php探针 phpinfo()函数禁用时使用

WBOY
WBOYOriginal
2016-07-25 08:54:022825Durchsuche
  1. header("content-type: text/html; charset=utf-8");

  2. header("cache-control: no-cache, must-revalidate");
  3. header("pragma: no-cache");
  4. error_reporting(0);
  5. ob_end_flush();
  6. ?>

  7. //加了这句,看看能不能解决linux下显示乱码的问题?
  8. php 探针 v1.0 - bbs.it-home.org
  9. [基本信息] [高级信息]
  10. if (function_exists("phpinfo")){
  11. echo'[phpinfo]';}
  12. echo'
    php探针v1.0 by mkduse(blueidea-id)

    此程序代码,可免费使用;但不得用于商业用途;完全转载或使用此代码,请保留版权信息;
    欢迎指正错误提建议,qq:122712355

';
  • if (empty($_get['typ'])){

  • baseinfo();}
  • else{
  • switch ($_get['typ']){
  • case 'phpinfo':
  • phpinfoview();
  • break;
  • case 'superinfo':
  • superinfo();
  • break;
  • case 'baseinfo':
  • baseinfo();
  • break;
  • default:
  • baseinfo();}
  • }
  • function getime()

  • {
  • $t = gettimeofday();
  • return (float)($t['sec'] + $t['usec']/1000000);
  • }
  • function baseinfo(){

  • echo '

    基本信息

    ';
  • $arr[]=array("current php version:",phpversion());
  • $arr[]=array("zend engine version:",zend_version());
  • $arr[]=array("服务器版本",$_server['server_software']);
  • $arr[]=array("ip地址",$_server['remote_host']);//ip
  • $arr[]=array("域名",$_server['http_host']);
  • $arr[]=array("协议端口",$_server['server_protocol'].'  '.$_server['server_port']);
  • $arr[]=array("站点根目录",$_server['path_translated']);
  • $arr[]=array("服务器时间",date('y年m月d日,h:i:s,d'));
  • $arr[]=array("当前用户",get_current_user());
  • $arr[]=array("操作系统",php_uname('s').php_uname('r').php_uname('v'));
  • $arr[]=array("include_path",ini_get('include_path'));
  • $arr[]=array("server api",php_sapi_name());
  • $arr[]=array("error_reporting level",ini_get("display_errors"));

  • $arr[]=array("post提交限制",ini_get('post_max_size'));
  • $arr[]=array("upload_max_filesize",ini_get('upload_max_filesize'));
  • $arr[]=array("脚本超时时间",ini_get('max_execution_time').'秒');
  • if (ini_get("safe_mode")==0){

  • $arr[]=array("php安全模式(safe_mode)",'off');}
  • else{
  • $arr[]=array("php安全模式(safe_mode)",'on');}
  • if (function_exists('memory_get_usage')){

  • $arr[]=array("memory_get_usage",ini_get('memory_get_usage'));}
  • //$arr[]=array("可用空间",intval(diskfreespace('/')/(1024 * 1024))."m");

  • echo'';
  • for($i=0;$i{
  • $overview='
  • ';
  • echo $overview;
  • }
  • echo'
  • '.$arr[$i][0].' '.$arr[$i][1].'
    ';
  • echo '

    服务器性能测试

    ';
  • echo'';
  • echo'
  • ';
  • $time_start=getime();
  • for($i=0;$i{$count=1+1;}
  • $timea=round((getime()-$time_start)*1000,2);
  • echo '
  • ';
  • $time_start=getime();

  • for($i=0;$i{sqrt(3.14);}
  • $timea=round((getime()-$time_start)*1000,2);
  • echo '
  • 服务器 整数运算
    50万次加法(1+1)
    浮点运算
    50万次平方根(3.14开方)
    mkduse的机子(p4 1.5g 256ddr winxp sp2) 465.08ms 466.66ms
    当前服务器 '.$timea.'ms '.$timea.'ms
    ';
  • ?>
  • echo '

    带宽测试

    ';
  • for ($i=0;$iprint "";}
  • ?>

  • echo'

    已加载的扩展库(enable)

    ';
  • $arr =get_loaded_extensions();
  • foreach($arr as $value){
  • echo $value.'
    ';}
  • echo'

  • 禁用的函数

    ';

  • $disfun=ini_get('disable_functions');
  • if (empty($disfun)){
  • echo'没有禁用';}
  • else{
  • echo ini_get('disable_functions').'';}
  • }//关闭

  • function superinfo(){

  • echo'

    高级信息

    php_ini_user 1 配置选项可用在用户的 php 脚本或windows 注册表中
    php_ini_perdir 2 配置选项可在 php.ini, .htaccess 或 httpd.conf 中设置
    php_ini_system 4 配置选项可在 php.ini or httpd.conf 中设置
    php_ini_all 7 配置选项可在各处设置

    ';
  • $arr1=ini_get_all();

  • for ($i=0;$i {
  • $arr2=array_slice($arr1,$i,1);
  • print_r($arr2);
  • echo '
    ';
  • }
  • }
  • function phpinfoview(){

  • phpinfo();
  • }
  • ?>
  • 复制代码

    php服务器探针显示php服务器信息 PHP探针获取客户端信息 带查看密码的php探针代码 php探针不显示cpu、内存、硬盘信息原因分析



  • Stellungnahme:
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn