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