-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha.php
119 lines (48 loc) · 1.27 KB
/
a.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
<?php
/*
* Check compatibility
* - PHP version
* - ioncube
* - curl
* - mbstring
* - gd with freetype
* - mysql/mysqli
*/
$phpVersion = phpversion();
$errors = array();
$php = explode('.', $phpVersion);
$phpVersionMain = $php[0];
$phpVersionSub = $php[0];
if($php[0] < 5 || ($php[0] == 5 && $php[1] < 3)) {
$errors[] = "PHP is incompatible $phpVersion";
}
$extensions = get_loaded_extensions();
$extensionsRequired = array(
'curl',
'gd',
'mbstring',
);
foreach($extensionsRequired as $extension) {
if (!in_array($extension, $extensions)) {
$errors[] = "No $extension";
}
}
if(!in_array('mysql', $extensions) && !in_array('mysqli', $extensions)) {
$errors[] = 'No MySQL';
}
if(function_exists('gd_info')) {
$gdInfo = gd_info();
if(!isset($gdInfo['FreeType Support']) || !$gdInfo['FreeType Support']) {
$errors[] = 'No GD FreeType Support';
}
}
if(count($errors)) {
echo '<b>Hosting configuration issues:</b><br>';
echo implode('<br>', $errors);
} else {
echo 'Hosting is compatible';
}
echo '<br><a href="' . $_SERVER['PHP_SELF'] . '?info=1">Info</a>';
if(isset($_GET['info'])) {
phpinfo();
}