-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinfo.php
More file actions
347 lines (280 loc) · 7.11 KB
/
info.php
File metadata and controls
347 lines (280 loc) · 7.11 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?php
/**
* http://PHPnow.org
* YinzCN_at_Gmail.com
*/
error_reporting(E_ALL);
define('TimeZone', + 8.0);
function _GET($n)
{
return isset($_GET[$n]) ? $_GET[$n] : null;
}
function _SERVER($n)
{
return isset($_SERVER[$n]) ? $_SERVER[$n] : '[undefine]';
}
if (_GET('act') == 'phpinfo')
{
if (function_exists('phpinfo')) phpinfo();
else echo 'phpinfo() has been disabled.';
exit;
}
$Info = array();
$Info['php_ini_file'] = function_exists('php_ini_loaded_file') ? php_ini_loaded_file() : '[undefine]';
if (_GET('act') == 'getip')
{
$i = _SERVER('SERVER_NAME') . '|' . _SERVER('REMOTE_ADDR') . '|' . _SERVER('SERVER_SOFTWARE') . '|' . (function_exists('mysql_close')?mysql_get_client_info():'') . '|' . _SERVER('DOCUMENT_ROOT');
$c = @file_get_contents('http://phpnow.org/myip.php?' . base64_encode($i));
if (preg_match('/^\d+\.\d+\.\d+\.\d+$/', $c) == 1) echo $c;
else echo 'false';
exit;
}
function colorhost()
{
$c = array('#87cefa', '#ffa500', '#ff6347', '#9acd32', '#32cd32', '#ee82ee');
$a = str_split(_SERVER('SERVER_NAME'));
$k = $l = 0;
foreach ($a as &$d)
{
while ($k == $l) $k = array_rand($c);
$d = '<b style="color: ' . $c[$k] . ';">' . $d . '</b>';
$l = $k;
}
return implode('', $a);
}
function get_ea_info($name)
{
$ea_info = eaccelerator_info();
return $ea_info[$name];
}
function get_gd_info($name)
{
$gd_info = gd_info();
return $gd_info[$name];
}
define('YES', '<span style="color: #008000; font-weight : bold;">Yes</span>');
define('NO', '<span style="color: #ff0000; font-weight : bold;">No</span>');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="YinzCN" />
<meta name="reply-to" content="YinzCN@Gmail.com" />
<meta name="copyright" content="YinzCN" />
<title>PHPnow Works!</title>
<style type="text/css">
<!--
body {
font-family: verdana, tahoma;
font-size: 12px;
margin-top: 10px;
}
form {
margin: 0;
}
table {
border-collapse: collapse;
}
.info tr td {
border: 1px solid #000000;
padding: 3px 10px 3px 10px;
}
.info th {
border: 1px solid #000000;
font-weight: bold;
height: 16px;
padding: 3px 10px 3px 10px;
background-color: #9acd32;
}
input {
border: 1px solid #000000;
background-color: #fafafa;
}
a {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
}
a.arrow {
font-family: webdings, sans-serif;
font-size: 10px;
}
a.arrow:hover {
color: #ff0000;
text-decoration: none;
}
.item {
white-space: nowrap;
text-align: right;
}
hr {
margin: 10px auto;
}
-->
</style>
<script type="text/JavaScript">
function $(id) { return document.getElementById(id); }
function get_ip() {
var xhr, r;
xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
r = xhr.responseText;
if (r == 'false') $('ip_r').innerHTML = '获取外网 IP 失败!';
else $('ip_r').innerHTML = '此服务器互联网 IP<br /><a href="http://' + r + '" style="color: #999999;">' + r + '</a>';
}
}
xhr.open("GET", "?act=getip", true);
xhr.send();
}
</script>
</head>
<body onload="get_ip();">
<div style="margin: 0 auto; width: 600px;">
<div style="height: 60px;">
<div style="float: right; margin: 5px; text-align: center;">
<div><a style="color: #ffa500;" href="http://phpnow.org/go.php?id=1005">为何只能本地访问?</a></div>
<div id="ip_r" style="color: #999999;">正在获取 IP 地址</div>
</div>
<div style="float: left;">
<div style="font-weight: bold; font-size: 2.2em;"><a href="<?php echo _SERVER('PHP_SELF');
?>?" style="text-decoration: none;"><?php echo colorhost();
?></a></div>
<div style="margin: 5px auto;"># Let's <b style="color: #777BB4;">PHP</b> <b style="color: #FF4500;">now</b> <b>!</b></div>
</div>
</div>
<br />
<table width="100%" class="info">
<tr>
<th colspan="2">Server Information</th>
</tr>
<tr>
<td class="item">SERVER_NAME</td>
<td><?php echo _SERVER('SERVER_NAME');
?></td>
</tr>
<tr>
<td class="item">SERVER_ADDR:PORT</td>
<td><?php echo _SERVER('SERVER_ADDR') . ':' . _SERVER('SERVER_PORT');
?></td>
</tr>
<tr>
<td class="item">SERVER_SOFTWARE</td>
<td><?php echo stripos(_SERVER('SERVER_SOFTWARE'), 'PHP')?_SERVER('SERVER_SOFTWARE'):_SERVER('SERVER_SOFTWARE') . ' PHP/' . PHP_VERSION;
?></td>
</tr>
<tr>
<td class="item">PHP_SAPI</td>
<td><?php echo PHP_SAPI;
?></td>
</tr>
<tr>
<td class="item" style="color: #ff0000;">php.ini</td>
<td><?php echo $Info['php_ini_file'];
?></td>
</tr>
<tr>
<td class="item">网站主目录</td>
<td><?php echo _SERVER('DOCUMENT_ROOT');
?></td>
</tr>
<tr>
<td class="item">Server Date / Time</td>
<td><?php echo gmdate('Y-m-d', time() + TimeZone * 3600);
?> <?php echo gmdate('H:i:s', time() + TimeZone * 3600);
?> <span style="color: #999999;">(<?php echo (TimeZone < 0?'-':'+') . gmdate('H:i', abs(TimeZone) * 3600);
?>)</span></td>
</tr>
<tr>
<td class="item">Other Links</td>
<td>
<a href='<?php echo _SERVER('PHP_SELF');
?>?act=phpinfo'>phpinfo()</a>
| <?php echo file_exists('phpMyAdmin') ? '<a href="/phpMyAdmin">phpMyAdmin</a>' : '';
?>
</td>
</tr>
</table>
<hr />
<table width="100%" class="info">
<tr>
<th colspan="2">PHP 组件支持必须全部为YES</th>
</tr>
<?php
$classPDO = class_exists("PDO");
$classSQLite3 = class_exists("SQLite3");
// PDO is there, check if the SQLite driver for PDO is missing
if ($classPDO)
{
$PDOSqliteDriver = (in_array("sqlite", PDO::getAvailableDrivers()));
}
else
{
$PDOSqliteDriver = false;
}
?>
<tr>
<td class="item">Curl 支持</td>
<td><?php echo function_exists('curl_init') ? YES . ' / ' : NO;
?></td>
</tr>
<tr>
<td class="item">soap 支持</td>
<td><?php echo function_exists('is_soap_fault') ? YES . ' / ' : NO;
?></td>
</tr>
<tr>
<td class="item">gettext 支持</td>
<td><?php echo function_exists('gettext') ? YES . ' / ' : NO;
?></td>
</tr>
<tr>
<td class="item">SQLite3 支持</td>
<td><?php echo $classSQLite3 ? YES . ' / ' . SQLite3::version()['versionString'] : NO;
?></td>
</tr>
<tr>
<td class="item">PDO SQLite 支持</td>
<td><?php echo $PDOSqliteDriver ? YES . ' / ' . 'PDO' : NO;
?></td>
</tr>
<tr>
<td class="item">openssl 支持</td>
<td><?php echo function_exists('openssl_open') ? YES . ' / ' . OPENSSL_VERSION_TEXT : NO;
?></td>
</tr>
<tr>
<td class="item">SimpleXML 支持</td>
<td><?php echo function_exists('simplexml_load_string') ? YES . ' / ' : NO;
?></td>
</tr>
</table>
<hr />
<table width="100%" class="info">
<tr>
<th colspan="4">PHP已编译模块检测</th>
</tr>
<tr>
<td colspan="4"><span class="w_small">
<?php
$able = get_loaded_extensions();
foreach ($able as $key => $value)
{
if ($key != 0 && $key % 10 == 0)
{
echo '<br />';
}
echo "$value ";
}
?>
</span>
</td>
</tr>
</table>
<hr />
</body>
</html>