commit | author | age
|
b3f9df
|
1 |
<form action="index.php" method="get"> |
354978
|
2 |
<?php |
T |
3 |
|
308f41
|
4 |
$required_php_exts = array('PCRE' => 'pcre', 'Session' => 'session'); |
6557d3
|
5 |
|
e18d04
|
6 |
$optional_php_exts = array('FileInfo' => 'fileinfo', 'Libiconv' => 'iconv', |
T |
7 |
'Multibyte' => 'mbstring', 'OpenSSL' => 'openssl', 'Mcrypt' => 'mcrypt', 'GD' => 'gd'); |
6557d3
|
8 |
|
T |
9 |
$required_libs = array('PEAR' => 'PEAR.php', 'DB' => 'DB.php', 'MDB2' => 'MDB2.php', |
|
10 |
'Net_SMTP' => 'Net/SMTP.php', 'Mail_mime' => 'Mail/mime.php', 'iilConnection' => 'lib/imap.inc'); |
|
11 |
|
|
12 |
$supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli', |
|
13 |
'PostgreSQL' => 'pgsql', 'SQLite (v2)' => 'sqlite'); |
c5042d
|
14 |
|
T |
15 |
$ini_checks = array('file_uploads' => 1, 'session.auto_start' => 0, |
019b5d
|
16 |
'magic_quotes_gpc' => 0, 'magic_quotes_sybase' => 0); |
6557d3
|
17 |
|
T |
18 |
$source_urls = array( |
|
19 |
'Sockets' => 'http://www.php.net/manual/en/ref.sockets.php', |
|
20 |
'Session' => 'http://www.php.net/manual/en/ref.session.php', |
|
21 |
'PCRE' => 'http://www.php.net/manual/en/ref.pcre.php', |
|
22 |
'FileInfo' => 'http://www.php.net/manual/en/ref.fileinfo.php', |
|
23 |
'Libiconv' => 'http://www.php.net/manual/en/ref.iconv.php', |
|
24 |
'Multibyte' => 'http://www.php.net/manual/en/ref.mbstring.php', |
e18d04
|
25 |
'Mcrypt' => 'http://www.php.net/manual/en/ref.mcrypt.php', |
6557d3
|
26 |
'OpenSSL' => 'http://www.php.net/manual/en/ref.openssl.php', |
e18d04
|
27 |
'GD' => 'http://www.php.net/manual/en/ref.image.php', |
6557d3
|
28 |
'PEAR' => 'http://pear.php.net', |
T |
29 |
'MDB2' => 'http://pear.php.net/package/MDB2', |
|
30 |
'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP', |
|
31 |
'Mail_mime' => 'http://pear.php.net/package/Mail_mime' |
|
32 |
); |
354978
|
33 |
|
1c4e5d
|
34 |
echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />'; |
354978
|
35 |
?> |
6557d3
|
36 |
|
T |
37 |
<h3>Checking PHP version</h3> |
|
38 |
<?php |
|
39 |
|
|
40 |
if (phpversion() > 4.3) { |
|
41 |
$RCI->pass('Version', 'PHP ' . phpversion() . ' detected'); |
7635d2
|
42 |
} else { |
6557d3
|
43 |
$RCI->fail('Version', 'PHP Version 4.3.1 or greater is required'); |
T |
44 |
} |
|
45 |
?> |
|
46 |
|
|
47 |
<h3>Checking PHP extensions</h3> |
|
48 |
<p class="hint">The following modules/extensions are <em>required</em> to run RoundCube:</p> |
|
49 |
<?php |
|
50 |
|
|
51 |
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; |
|
52 |
foreach ($required_php_exts AS $name => $ext) { |
|
53 |
if (extension_loaded($ext)) { |
|
54 |
$RCI->pass($name); |
7635d2
|
55 |
} else { |
6557d3
|
56 |
$_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX; |
T |
57 |
$msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : ''; |
|
58 |
$RCI->fail($name, $msg, $source_urls[$name]); |
|
59 |
} |
|
60 |
echo '<br />'; |
|
61 |
} |
|
62 |
|
|
63 |
?> |
|
64 |
|
308f41
|
65 |
<p class="hint">The next couple of extensions are <em>optional</em> but recommended to get the best performance:</p> |
6557d3
|
66 |
<?php |
T |
67 |
|
|
68 |
foreach ($optional_php_exts AS $name => $ext) { |
|
69 |
if (extension_loaded($ext)) { |
|
70 |
$RCI->pass($name); |
|
71 |
} |
|
72 |
else { |
|
73 |
$_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX; |
|
74 |
$msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : ''; |
|
75 |
$RCI->na($name, $msg, $source_urls[$name]); |
|
76 |
} |
|
77 |
echo '<br />'; |
|
78 |
} |
|
79 |
|
|
80 |
?> |
|
81 |
|
|
82 |
|
|
83 |
<h3>Checking available databases</h3> |
|
84 |
<p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p> |
|
85 |
|
|
86 |
<?php |
|
87 |
|
|
88 |
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; |
|
89 |
foreach ($supported_dbs AS $database => $ext) { |
|
90 |
if (extension_loaded($ext)) { |
|
91 |
$RCI->pass($database); |
|
92 |
} |
|
93 |
else { |
|
94 |
$_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX; |
|
95 |
$msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : 'Not installed'; |
|
96 |
$RCI->na($database, $msg, $source_urls[$database]); |
|
97 |
} |
|
98 |
echo '<br />'; |
|
99 |
} |
|
100 |
|
|
101 |
?> |
|
102 |
|
|
103 |
|
|
104 |
<h3>Check for required 3rd party libs</h3> |
|
105 |
<p class="hint">This also checks if the include path is set correctly.</p> |
|
106 |
|
|
107 |
<?php |
|
108 |
|
|
109 |
foreach ($required_libs as $classname => $file) { |
|
110 |
@include_once $file; |
|
111 |
if (class_exists($classname)) { |
|
112 |
$RCI->pass($classname); |
|
113 |
} |
|
114 |
else if ($classname == 'DB' || ($classname == 'MDB2' && class_exists('DB'))) { |
|
115 |
$RCI->na($classname, 'Use ' . ($classname == 'DB' ? 'MDB2' : 'DB') . ' instead'); |
|
116 |
} |
|
117 |
else { |
|
118 |
$RCI->fail($classname, "Failed to load $file", $source_urls[$classname]); |
|
119 |
} |
|
120 |
echo "<br />"; |
|
121 |
} |
|
122 |
|
c5042d
|
123 |
|
T |
124 |
?> |
|
125 |
|
|
126 |
<h3>Checking php.ini/.htaccess settings</h3> |
|
127 |
|
|
128 |
<?php |
|
129 |
|
|
130 |
foreach ($ini_checks as $var => $val) { |
|
131 |
$status = ini_get($var); |
|
132 |
if ($status == $val) { |
|
133 |
$RCI->pass($var); |
|
134 |
} |
|
135 |
else { |
|
136 |
$RCI->fail($var, "is '$status', should be '$val'"); |
|
137 |
} |
|
138 |
echo '<br />'; |
|
139 |
} |
|
140 |
?> |
|
141 |
|
|
142 |
<?php |
|
143 |
|
019b5d
|
144 |
if ($RCI->failures) { |
6557d3
|
145 |
echo '<p class="warning">Sorry but your webserver does not meet the requirements for RoundCube!<br /> |
4a2765
|
146 |
Please install the missing modules or fix the php.ini settings according to the above check results.<br /> |
T |
147 |
Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>'; |
019b5d
|
148 |
} |
6557d3
|
149 |
echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>'; |
T |
150 |
|
|
151 |
?> |
|
152 |
|
354978
|
153 |
</form> |