php.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Server PHP info
  4. */
  5. $php_log = ini_get('error_log');
  6. if (!$php_log) {
  7. $php_log = elgg_echo('admin:server:error_log');
  8. }
  9. $post_max_size = elgg_get_ini_setting_in_bytes('post_max_size');
  10. $upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize');
  11. $post_max_size_warning = '';
  12. if ($upload_max_filesize > $post_max_size) {
  13. // @todo show a link to something like http://nigel.mcnie.name/blog/uploadmaxfilesizepostmaxsize-experimentation ?
  14. $post_max_size_warning = elgg_echo('admin:server:warning:post_max_too_small');
  15. }
  16. ?>
  17. <table class="elgg-table-alt">
  18. <tr class="odd">
  19. <td><b><?php echo elgg_echo('admin:server:label:php_version'); ?> :</b></td>
  20. <td><?php echo phpversion(); ?></td>
  21. </tr>
  22. <tr class="even">
  23. <td><b><?php echo elgg_echo('admin:server:label:php_ini'); ?> :</b></td>
  24. <td><?php echo php_ini_loaded_file(); ?></td>
  25. </tr>
  26. <tr class="odd">
  27. <td><b><?php echo elgg_echo('admin:server:label:php_log'); ?> :</b></td>
  28. <td><?php echo $php_log; ?></td>
  29. </tr>
  30. <tr class="even">
  31. <td><b><?php echo elgg_echo('admin:server:label:mem_avail'); ?> :</b></td>
  32. <td><?php echo number_format(elgg_get_ini_setting_in_bytes('memory_limit')); ?></td>
  33. </tr>
  34. <tr class="odd">
  35. <td><b><?php echo elgg_echo('admin:server:label:mem_used'); ?> :</b></td>
  36. <td><?php echo number_format(memory_get_peak_usage()); ?></td>
  37. </tr>
  38. <tr class="even">
  39. <td><b><?php echo elgg_echo('admin:server:label:post_max_size'); ?> :</b></td>
  40. <td><?php echo number_format($post_max_size); ?></td>
  41. </tr>
  42. <tr class="odd">
  43. <td><b><?php echo elgg_echo('admin:server:label:upload_max_filesize'); ?> :</b></td>
  44. <td><?php echo number_format($upload_max_filesize) . '&nbsp; ' . $post_max_size_warning; ?></td>
  45. </tr>
  46. </table>