1 <form action="index.php" method="get">
4 $required_php_exts = array(
7 'Session' => 'session',
12 $optional_php_exts = array(
13 'FileInfo' => 'fileinfo',
14 'Libiconv' => 'iconv',
15 'Multibyte' => 'mbstring',
16 'OpenSSL' => 'openssl',
21 $required_libs = array(
24 'Net_SMTP' => 'Net/SMTP.php',
25 'Mail_mime' => 'Mail/mime.php',
28 $supported_dbs = array(
31 'PostgreSQL' => 'pgsql',
32 'SQLite (v2)' => 'sqlite',
37 'session.auto_start' => 0,
38 'zend.ze1_compatibility_mode' => 0,
39 'mbstring.func_overload' => 0,
40 'suhosin.session.encrypt' => 0,
43 $optional_checks = array(
44 'date.timezone' => '-NOTEMPTY-',
48 'Sockets' => 'http://www.php.net/manual/en/book.sockets.php',
49 'Session' => 'http://www.php.net/manual/en/book.session.php',
50 'PCRE' => 'http://www.php.net/manual/en/book.pcre.php',
51 'FileInfo' => 'http://www.php.net/manual/en/book.fileinfo.php',
52 'Libiconv' => 'http://www.php.net/manual/en/book.iconv.php',
53 'Multibyte' => 'http://www.php.net/manual/en/book.mbstring.php',
54 'Mcrypt' => 'http://www.php.net/manual/en/book.mcrypt.php',
55 'OpenSSL' => 'http://www.php.net/manual/en/book.openssl.php',
56 'JSON' => 'http://www.php.net/manual/en/book.json.php',
57 'DOM' => 'http://www.php.net/manual/en/book.dom.php',
58 'Intl' => 'http://www.php.net/manual/en/book.intl.php',
59 'PEAR' => 'http://pear.php.net',
60 'MDB2' => 'http://pear.php.net/package/MDB2',
61 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP',
62 'Mail_mime' => 'http://pear.php.net/package/Mail_mime',
65 echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />';
68 <h3>Checking PHP version</h3>
71 define('MIN_PHP_VERSION', '5.2.1');
72 if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
73 $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
75 $RCI->fail('Version', 'PHP Version ' . MIN_PHP_VERSION . ' or greater is required ' . PHP_VERSION . ' detected');
79 <h3>Checking PHP extensions</h3>
80 <p class="hint">The following modules/extensions are <em>required</em> to run Roundcube:</p>
83 // get extensions location
84 $ext_dir = ini_get('extension_dir');
86 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
87 foreach ($required_php_exts as $name => $ext) {
88 if (extension_loaded($ext)) {
91 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
92 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
93 $RCI->fail($name, $msg, $source_urls[$name]);
100 <p class="hint">The next couple of extensions are <em>optional</em> and recommended to get the best performance:</p>
103 foreach ($optional_php_exts as $name => $ext) {
104 if (extension_loaded($ext)) {
108 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
109 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
110 $RCI->na($name, $msg, $source_urls[$name]);
118 <h3>Checking available databases</h3>
119 <p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p>
123 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
124 foreach ($supported_dbs as $database => $ext) {
125 if (extension_loaded($ext)) {
126 $RCI->pass($database);
129 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
130 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : 'Not installed';
131 $RCI->na($database, $msg, $source_urls[$database]);
139 <h3>Check for required 3rd party libs</h3>
140 <p class="hint">This also checks if the include path is set correctly.</p>
144 foreach ($required_libs as $classname => $file) {
146 if (class_exists($classname)) {
147 $RCI->pass($classname);
150 $RCI->fail($classname, "Failed to load $file", $source_urls[$classname]);
158 <h3>Checking php.ini/.htaccess settings</h3>
159 <p class="hint">The following settings are <em>required</em> to run Roundcube:</p>
163 foreach ($ini_checks as $var => $val) {
164 $status = ini_get($var);
165 if ($val === '-NOTEMPTY-') {
166 if (empty($status)) {
167 $RCI->fail($var, "cannot be empty and needs to be set");
174 if ($status == $val) {
177 $RCI->fail($var, "is '$status', should be '$val'");
183 <p class="hint">The following settings are <em>optional</em> and recommended:</p>
187 foreach ($optional_checks as $var => $val) {
188 $status = ini_get($var);
189 if ($val === '-NOTEMPTY-') {
190 if (empty($status)) {
191 $RCI->optfail($var, "Could be set");
198 if ($status == $val) {
201 $RCI->optfail($var, "is '$status', could be '$val'");
209 if ($RCI->failures) {
210 echo '<p class="warning">Sorry but your webserver does not meet the requirements for Roundcube!<br />
211 Please install the missing modules or fix the php.ini settings according to the above check results.<br />
212 Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>';
214 echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';