-
Notifications
You must be signed in to change notification settings - Fork 7
/
_compatibility.php
executable file
·98 lines (90 loc) · 3.39 KB
/
_compatibility.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
ini_set('display_errors', 0);
define(PHP_VER, '5.2');
define(TOTAL_SCORE, '9');
$result = array();
$score = 0;
//check PHP version
if(version_compare(PHP_VERSION, PHP_VER)==-1)
$result[] = '<span class="label label-important"><i class="icon-remove icon-white"></i> Sendy requires PHP '.PHP_VER.' to run, your have '.PHP_VERSION.'</span>';
else
{
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> Your PHP version is '.PHP_VERSION.'</span>';
$score++;
}
//check if mysqli extension is installed
if (function_exists("mysqli_connect")) {
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> mysqli extension is installed</span>';
$score++;
}
else
$result[] = '<span class="label label-important"><i class="icon-remove icon-white"></i> mysqli extension is not installed</span>';
//check mod_rewrite
if (function_exists("apache_get_modules")) {
$modules = apache_get_modules();
$mod_rewrite = in_array("mod_rewrite",$modules);
if($mod_rewrite)
{
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> mod_rewrite is enabled</span>';
$score++;
}
else
$result[] = '<span class="label label-warning"><i class="icon-remove icon-white"></i> mod_rewrite is not enabled</span>';
}
else
$result[] = '<span class="label label-warning"><i class="icon-remove icon-white"></i> mod_rewrite is not enabled</span>';
//check if display_errors is on
if(ini_get('display_errors'))
$result[] = '<span class="label label-important"><i class="icon-remove icon-white"></i> display_errors is turned on</span>';
else
{
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> display_errors is turned off</span>';
$score++;
}
//check
$exts = array('hash', 'curl', 'gettext');
foreach($exts as $ext) {
if(extension_loaded($ext))
{
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> '.$ext.' is enabled</span>';
$score++;
}
else
$result[] = '<span class="label label-important"><i class="icon-remove icon-white"></i> '.$ext.' is not enabled</span>';
}
//check if curl_exec is enabled
function curl_exec_enabled()
{
$disabled = explode(',', ini_get('disable_functions'));
if(in_array('curl_exec', $disabled)) return false;
else return true;
}
if(curl_exec_enabled())
{
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> curl_exec is enabled</span>';
$score++;
}
else $result[] = '<span class="label label-important"><i class="icon-remove icon-white"></i> curl_exec is disabled</span>';
//check if curl_multi_exec is enabled
function curl_multi_exec_enabled()
{
$disabled = explode(',', ini_get('disable_functions'));
if(in_array('curl_multi_exec', $disabled)) return false;
else return true;
}
if(curl_multi_exec_enabled())
{
$result[] = '<span class="label label-success"><i class="icon-ok icon-white"></i> curl_multi_exec is enabled</span>';
$score++;
}
else $result[] = '<span class="label label-important"><i class="icon-remove icon-white"></i> curl_multi_exec is disabled</span>';
if($_GET['i']==1)
{
echo '<h2>Server configuration:</h2><hr/>';
//return results
foreach($result as $results){
echo $results.'<br/>';
}
echo '<br/>Score: '.$score.'/'.TOTAL_SCORE;
}
?>