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