-
Notifications
You must be signed in to change notification settings - Fork 1
/
servercheck.php
156 lines (148 loc) · 5.5 KB
/
servercheck.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
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
<?php
echo 'aaaa';
echo 'bbbb';
$requirements = array(
'php_min_version' => '5.3',
'php_extensions' => array(
'pdo_mysql' => true,
'imagick' => true,
'gd' => true,
'ionCube Loader' => true,
'curl' => true,
'mbstring' => true,
'openssl' => true,
'zlib' => true,
'json' => true,
'mcrypt' => true,
'zip' => true,
'ftp' => true,
'suhosin' => false
),
'php_settings' => array(
'register_globals' => 0,
//'register_long_arrays' => 0,
'magic_quotes' => 0,
'magic_quotes_gpc' => 0,
'file_uploads' => 1,
'memory_limit' => 64,
'session.auto_start' => 0,
'session.use_trans_sid' => 0
)
);
$successIcon = '<span class="ui-icon-colored ui-icon-green ui-icon-check"></span>';
$warningIcon = '<span class="ui-icon-colored ui-icon-yellow ui-icon-alert"></span>';
$errorIcon = '<span class="ui-icon-colored ui-icon-red ui-icon-closethick"></span>';
$infoIcon = '<span class="ui-icon-colored ui-icon-blue ui-icon-info" style="display:inline-block;"></span>';
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sales Igniter Checker</title>
<meta name="robots" content="noindex,nofollow">
<link rel="stylesheet" type="text/css" href="ext/jQuery/themes/smoothness/ui.all.css">
<script type="text/javascript" src="ext/jQuery/jQuery.js"></script>
<script type="text/javascript" src="ext/jQuery/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="ext/jQuery/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="ext/jQuery/ui/jquery.ui.button.js"></script>
<script type="text/javascript">
var curStep = 'auth';
$(document).ready(function (){
$('.phpVersion').append('<tr>' +
'<td align="left"><?php echo $requirements['php_min_version'];?></td>' +
'<td align="right"><?php echo PHP_VERSION;?></td>' +
'<td align="center" style="width:20px;"><?php echo (version_compare(PHP_VERSION, $requirements['php_min_version']) ? $successIcon : $errorIcon);?></td>' +
'</tr>');
<?php
//check suhosin
foreach($requirements['php_extensions'] as $name => $req){
if($name != 'suhosin'){
?>
$('.phpExt').append('<tr>' +
'<td align="left"><?php echo $name;?></td>' +
'<td align="right"><?php echo (extension_loaded($name) ? 'Installed' : 'Not Installed');?></td>' +
'<td align="center" style="width:20px;"><?php echo (extension_loaded($name) == $req ? $successIcon : $errorIcon);?></td>' +
'</tr>');
<?php
}else{
if(extension_loaded($name)){
?>
$('.phpExt').append('<tr>' +
'<td align="left"><?php echo $name;?></td>' +
'<td align="right"><?php echo (extension_loaded($name) ? 'suhosin.get.max_value_length must be set to 1012' : '');?></td>' +
'<td align="center" style="width:20px;"></td>' +
'</tr>');
<?php
}
}
}
//memory limit
foreach($requirements['php_settings'] as $name => $req){
if($name != 'memory_limit'){
?>
$('.phpSettings').append('<tr>' +
'<td align="left"><?php echo $name;?></td>' +
'<td align="right"><?php echo ((int) ini_get($name) == 0 ? 'Off' : 'On');?></td>' +
'<td align="center" style="width:20px;"><?php echo ((int) ini_get($name) == $req ? $successIcon : $errorIcon);?></td>' +
'</tr>');
<?php
}else{
?>
$('.phpSettings').append('<tr>' +
'<td align="left"><?php echo $name.'(64MB+)';?></td>' +
'<td align="right"><?php echo ((int) ini_get($name) >=64 ? 'Ok' : 'Required 64MB+ ');?></td>' +
'<td align="center" style="width:20px;"><?php echo ((int) ini_get($name) >= $req ? $successIcon : $errorIcon);?></td>' +
'</tr>');
<?php
}
}
?>
});
</script>
<style>
body { font-size: 100%;font-family:Helvetica, Tahoma, Arial;color:#302e2e; }
td { font-size: .8em; }
div { position: relative; }
.errorBox > span { line-height:2em;margin-left:.5em; }
.pageHeader > span { line-height:2em;margin-left:.5em; }
.pageInfoboxHeader > span { line-height:2em;margin-left:.5em; }
.reqBox { border-color:#ffcb05; }
.reqHeader { border-color:#f58220;background-color:#f58220;color:#4c4c4c;margin:.2em; }
.reqHeader > span { line-height:2em;margin-left:.5em; }
.ui-icon-colored { width: 16px; height: 16px;display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
.ui-icon-red { background-image: url(ext/jQuery/themes/icons/ui-icons_cc0000_256x240.png); }
.ui-icon-green { background-image: url(ext/jQuery/themes/icons/ui-icons_2ef91f_256x240.png); }
.ui-icon-blue { background-image: url(ext/jQuery/themes/icons/ui-icons_2e83ff_256x240.png); }
.ui-icon-yellow { background-image: url(ext/jQuery/themes/icons/ui-icons_f2ec64_256x240.png); }
</style>
<script type="text/javascript">
</script>
</head>
<body>
<table cellpadding="5" cellspacing="0" border="0" width="100%">
<tr>
<td valign="top" style="width:250px;">
<div class="ui-widget-content reqBox">
<div class="ui-widget-header reqHeader">
<span>System Requirements</span>
</div>
<div><table cellpadding="3" cellspacing="3" border="0" width="100%" class="phpVersion">
<tr>
<td><b><u>PHP Version</u></b></td>
</tr>
</table>
<table cellpadding="3" cellspacing="3" border="0" width="100%" class="phpExt">
<tr>
<td colspan="3"><b><u>PHP Extensions</u></b></td>
</tr>
</table>
<table cellpadding="3" cellspacing="3" border="0" width="100%" class="phpSettings">
<tr>
<td colspan="3"><b><u>PHP Settings</u></b></td>
</tr>
</table></div>
</div>
</td>
</tr>
</table>
</body>
</html>