Home > Backend Development > PHP Tutorial > PHP probe used when phpinfo() function is disabled

PHP probe used when phpinfo() function is disabled

WBOY
Release: 2016-07-25 08:54:02
Original
2908 people have browsed it
  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 '

    Basic information

    ';
  • $arr[]=array("current php version:",phpversion( ));
  • $arr[]=array("zend engine version:",zend_version());
  • $arr[]=array("server version",$_server['server_software']);
  • $arr[] =array("ip address",$_server['remote_host']);//ip
  • $arr[]=array("domain name",$_server['http_host']);
  • $arr[]=array(" Protocol port",$_server['server_protocol'].'  '.$_server['server_port']);
  • $arr[]=array("site root directory",$_server['path_translated']) ;
  • $arr[]=array("Server time",date('y year m month d day,h:i:s,d'));
  • $arr[]=array("current user",get_current_user( ));
  • $arr[]=array("operating system",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 submission limit",ini_get('post_max_size'));
  • $arr[]=array("upload_max_filesize",ini_get('upload_max_filesize'));
  • $ arr[]=array("Script timeout",ini_get('max_execution_time').'seconds');

  • if (ini_get("safe_mode")==0){

  • $arr []=array("php safe mode (safe_mode)",'off');}
  • else{
  • $arr[]=array("php safe mode (safe_mode)",'on');}
  • if (function_exists('memory_get_usage')){

  • $arr[]=array("memory_get_usage",ini_get('memory_get_usage'));}

  • //$ arr[]=array("Available space",intval(diskfreespace('/')/(1024 * 1024))."m");

  • echo'';
  • for($i=0;$ i{
  • $overview='
  • ';
  • echo $overview;
  • }
  • echo'
  • '.$arr[$i][0].' '.$arr[$i][1].'
    ';
  • echo '< ;h2>Server performance test';
  • echo'';
  • echo'mkduse machine (p4 1.5g 256ddr winxp sp2)
  • ';
  • $ time_start=getime();
  • for($i=0;$i<=500000;$i++);
  • {$count=1+1;}
  • $timea=round((getime()-$time_start)*1000 ,2);
  • echo '
  • ';

  • $time_start=getime();

  • for($i=0;$i<=500000;$i++);
  • {sqrt(3.14);}
  • $timea=round((getime()-$ time_start)*1000,2);
  • echo '
  • ServerInteger operation
    500,000 additions (1+1)
    Floating point operations
    500,000 square roots (3.14 square roots)
    465.08ms466.66ms
    Current server'.$timea.'ms '.$timea.'ms
    ';

  • ? >
  • echo '

    Bandwidth Test

    ';
  • for ($i=0;$i<100;$i++){
  • print "";}

  • ?>

  • echo'

    Loaded extension library (enable)

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

  • echo'

  • Disabled functions

    ';

  • $disfun=ini_get('disable_functions' );
  • if (empty($disfun)){
  • echo 'not disabled

    ';}
  • else{
  • echo ini_get('disable_functions').'

    ';}
  • }//Close

  • function superinfo(){

  • echo'

    Advanced information

    php_ini_user 1 configuration options available in user php script or windows registry
    php_ini_perdir 2 Configuration options can be set in php.ini, .htaccess or httpd.conf
    php_ini_system 4 Configuration options can be set in php.ini or httpd.conf< ;br>php_ini_all 7 Configuration options can be set everywhere

    ';

  • $arr1=ini_get_all();

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

  • function phpinfoview(){

  • phpinfo();
  • }
  • ?>
  • Copy code

    php server probe displays php server information PHP probe to obtain client information php probe code with view password Analysis of the reasons why the php probe does not display cpu, memory, and hard disk information



  • source:php.cn
    Statement of this Website
    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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template