| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
* Let's dump some information about this php install |
|---|
| 4 |
* |
|---|
| 5 |
* eAccelerator, (c) 2006 - http://www.eaccelerator.net |
|---|
| 6 |
*/ |
|---|
| 7 |
|
|---|
| 8 |
$sapi = php_sapi_name(); |
|---|
| 9 |
switch ($sapi) { |
|---|
| 10 |
case 'apache': |
|---|
| 11 |
case 'apache2handler': |
|---|
| 12 |
case 'apache2filter': |
|---|
| 13 |
case 'cgi-fcgi': |
|---|
| 14 |
break; |
|---|
| 15 |
default: |
|---|
| 16 |
die("eAccelerator doesn't work with the SAPI you are using!\n"); |
|---|
| 17 |
} |
|---|
| 18 |
|
|---|
| 19 |
if (!extension_loaded('eaccelerator') && !extension_loaded('eAccelerator') ) { |
|---|
| 20 |
die("eAccelerator isn't loaded, why do you want to report a bug?\n"); |
|---|
| 21 |
} |
|---|
| 22 |
|
|---|
| 23 |
if (!function_exists('eaccelerator_info')) { |
|---|
| 24 |
echo "WARNING: Please compile eAccelerator with --with-eacelerator-info ". |
|---|
| 25 |
"to provide us more information about your configuration.\n"; |
|---|
| 26 |
} |
|---|
| 27 |
|
|---|
| 28 |
header('Content-type: text/plain'); |
|---|
| 29 |
header('Content-Disposition: attachment; filename="bugreport.txt"'); |
|---|
| 30 |
?> |
|---|
| 31 |
eAccelerator bug report |
|---|
| 32 |
======================= |
|---|
| 33 |
|
|---|
| 34 |
PHP Information |
|---|
| 35 |
--------------- |
|---|
| 36 |
<?php |
|---|
| 37 |
printf("PHP Version: %s, Zend version: %s (SAPI: %s)\n", phpversion(), zend_version(), $sapi); |
|---|
| 38 |
printf("uname -a: %s\n", php_uname()); |
|---|
| 39 |
|
|---|
| 40 |
$first = True; |
|---|
| 41 |
foreach (get_loaded_extensions() as $extension) { |
|---|
| 42 |
if ($first) { |
|---|
| 43 |
$first = False; |
|---|
| 44 |
echo "Extensions:\t $extension\n"; |
|---|
| 45 |
} else { |
|---|
| 46 |
echo "\t\t $extension\n"; |
|---|
| 47 |
} |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
if (strstr($sapi, 'apache')) { |
|---|
| 51 |
?> |
|---|
| 52 |
|
|---|
| 53 |
Apache information |
|---|
| 54 |
------------------ |
|---|
| 55 |
<?php |
|---|
| 56 |
printf("Apache version: %s\n", apache_get_version()); |
|---|
| 57 |
|
|---|
| 58 |
$first = True; |
|---|
| 59 |
foreach (apache_get_modules() as $module) { |
|---|
| 60 |
if ($first) { |
|---|
| 61 |
$first = False; |
|---|
| 62 |
echo "Module:\t\t $module\n"; |
|---|
| 63 |
} else { |
|---|
| 64 |
echo "\t\t $module\n"; |
|---|
| 65 |
} |
|---|
| 66 |
} |
|---|
| 67 |
} |
|---|
| 68 |
?> |
|---|
| 69 |
|
|---|
| 70 |
eAccelerator information |
|---|
| 71 |
------------------------ |
|---|
| 72 |
<?php |
|---|
| 73 |
if (!function_exists('eaccelerator_info')) { |
|---|
| 74 |
echo "eAccelerator isn't compiled with info support :("; |
|---|
| 75 |
return; |
|---|
| 76 |
} |
|---|
| 77 |
$info = eaccelerator_info(); |
|---|
| 78 |
foreach ($info as $key => $line) { |
|---|
| 79 |
echo "$key: $line\n"; |
|---|
| 80 |
} |
|---|
| 81 |
|
|---|
| 82 |
echo "\neAccelerator options:\n"; |
|---|
| 83 |
$ini = ini_get_all(); |
|---|
| 84 |
foreach ($ini as $key => $value) { |
|---|
| 85 |
if (strstr($key, "eaccelerator")) { |
|---|
| 86 |
printf("\t$key: %s\n", $value['global_value']); |
|---|
| 87 |
} |
|---|
| 88 |
} |
|---|
| 89 |
|
|---|
| 90 |
$cachedir = $ini['eaccelerator.cache_dir']['global_value']; |
|---|
| 91 |
if (!is_dir($cachedir)) { |
|---|
| 92 |
echo "$cachedir doesn't exist!\n"; |
|---|
| 93 |
} elseif (is_writeable($cachedir)) { |
|---|
| 94 |
echo "$cachedir isn't writable!"; |
|---|
| 95 |
} else { |
|---|
| 96 |
echo "Cachedir seems ok!"; |
|---|
| 97 |
} |
|---|
| 98 |
?> |
|---|
| 99 |
|
|---|