sys_tech_info.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /**
  3. * 系统技术信息
  4. *
  5. * @createtime 2018/4/14
  6. * @author 空竹
  7. * @copyright 芝麻开发(http://www.zhimawork.com)
  8. */
  9. require_once('admin_init.php');
  10. require_once('admincheck.php');
  11. $POWERID = '9002';//权限
  12. Admin::checkAuth($POWERID, $ADMINAUTH);
  13. //判断操作系统位数的简易方法
  14. if(is_float(12345678900)){
  15. $sysbit = '32';
  16. }else{
  17. $sysbit = '64';
  18. }
  19. //获取目录大小
  20. function get_folder_size($path) {
  21. $total_size = 0;
  22. $files = scandir($path);
  23. foreach($files as $t) {
  24. if (is_dir(rtrim($path, '/') . '/' . $t)) {
  25. if ($t<>"." && $t<>"..") {
  26. $size = get_folder_size(rtrim($path, '/') . '/' . $t);
  27. $total_size += $size;
  28. }
  29. } else {
  30. $size = filesize(rtrim($path, '/') . '/' . $t);
  31. $total_size += $size;
  32. }
  33. }
  34. return $total_size;
  35. }
  36. function get_format_filesize($size) {
  37. $mod = 1024;
  38. $units = explode(' ','B KB MB GB TB PB');
  39. for ($i = 0; $size > $mod; $i++) {
  40. $size /= $mod;
  41. }
  42. return round($size, 2) . ' ' . $units[$i];
  43. }
  44. ?>
  45. <!DOCTYPE html>
  46. <html>
  47. <head>
  48. <?php include('htmlhead.inc.php');?>
  49. <title>技术信息 - 系统信息 - 管理系统 </title>
  50. </head>
  51. <body>
  52. <div id="header">
  53. <?php include('top.inc.php');?>
  54. <?php
  55. $FLAG_TOPNAV = "system";
  56. include('nav.inc.php');
  57. ?>
  58. </div>
  59. <div id="container">
  60. <?php
  61. $FLAG_LEFTMENU = 'sys_tech_info';
  62. include('admin_menu.inc.php');
  63. ?>
  64. <div id="maincontent">
  65. <div class="tablelist">
  66. <table>
  67. <tr>
  68. <th width="10%">No.</th>
  69. <th width="30%">Item</th>
  70. <th width="60%">Value</th>
  71. </tr>
  72. <tr>
  73. <td class="center">1</td>
  74. <td>技术架构</td>
  75. <td>PHP+MySQL</td>
  76. </tr>
  77. <tr>
  78. <td class="center">2</td>
  79. <td>Server版本</td>
  80. <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
  81. </tr>
  82. <tr>
  83. <td class="center">3</td>
  84. <td>ZhimaPHP版本</td>
  85. <td><?php echo ZHIMAPHP_VERSION;?></td>
  86. </tr>
  87. <tr>
  88. <td class="center">4</td>
  89. <td>服务器操作系统</td>
  90. <td><?php echo php_uname();?>(<?php echo $sysbit?>位)</td>
  91. </tr>
  92. <tr>
  93. <td class="center">5</td>
  94. <td>服务器IP地址</td>
  95. <td><?php $serverip = gethostbyname($_SERVER['SERVER_NAME']); echo $serverip;?>(<a href="https://www.baidu.com/s?wd=<?php echo $serverip?>" target="_blank">点击查看服务器地理位置</a>)</td>
  96. </tr>
  97. <tr>
  98. <td class="center">6</td>
  99. <td>服务器时区</td>
  100. <td><?php echo date_default_timezone_get();?></td>
  101. </tr>
  102. <tr>
  103. <td class="center">7</td>
  104. <td>服务器时间</td>
  105. <td><?php echo date('Y-m-d H:i:s');?></td>
  106. </tr>
  107. <tr>
  108. <td class="center">8</td>
  109. <td>服务器启用gzip</td>
  110. <td><?php echo $_SERVER["HTTP_ACCEPT_ENCODING"];?></td>
  111. </tr>
  112. <tr>
  113. <td class="center">9</td>
  114. <td>服务器PHP环境设置(常用)</td>
  115. <td>
  116. POST大小限制:<?php echo get_cfg_var('post_max_size')?><br/>
  117. 上传单个文件大小限制:<?php echo get_cfg_var('upload_max_filesize')?><br/>
  118. 函数限制:<?php echo get_cfg_var('disable_functions')?><br/>
  119. 错误调试状态:<?php echo get_cfg_var('display_errors')?>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td class="center">10</td>
  124. <td>用户上传文件占用空间</td>
  125. <td><?php echo get_format_filesize(get_folder_size($FILE_PATH.'userfiles'));?>(根目录下userfiles的大小)</td>
  126. </tr>
  127. </table>
  128. </div>
  129. </div>
  130. <div class="clear"></div>
  131. </div>
  132. <?php include('footer.inc.php');?>
  133. </body>
  134. </html>