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 'Net_IDNA2' => 'Net/IDNA2.php',
26 'Mail_mime' => 'Mail/mime.php',
29 $supported_dbs = array(
32 'PostgreSQL' => 'pgsql',
33 'SQLite (v2)' => 'sqlite',
38 'session.auto_start' => 0,
39 'zend.ze1_compatibility_mode' => 0,
40 'mbstring.func_overload' => 0,
41 'suhosin.session.encrypt' => 0,
44 $optional_checks = array(
45 'date.timezone' => '-NOTEMPTY-',
49 'Sockets' => 'http://www.php.net/manual/en/book.sockets.php',
50 'Session' => 'http://www.php.net/manual/en/book.session.php',
51 'PCRE' => 'http://www.php.net/manual/en/book.pcre.php',
52 'FileInfo' => 'http://www.php.net/manual/en/book.fileinfo.php',
53 'Libiconv' => 'http://www.php.net/manual/en/book.iconv.php',
54 'Multibyte' => 'http://www.php.net/manual/en/book.mbstring.php',
55 'Mcrypt' => 'http://www.php.net/manual/en/book.mcrypt.php',
56 'OpenSSL' => 'http://www.php.net/manual/en/book.openssl.php',
57 'JSON' => 'http://www.php.net/manual/en/book.json.php',
58 'DOM' => 'http://www.php.net/manual/en/book.dom.php',
59 'Intl' => 'http://www.php.net/manual/en/book.intl.php',
60 'PEAR' => 'http://pear.php.net',
61 'MDB2' => 'http://pear.php.net/package/MDB2',
62 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP',
63 'Mail_mime' => 'http://pear.php.net/package/Mail_mime',
66 echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />';
69 <h3>Checking PHP version</h3>
72 define('MIN_PHP_VERSION', '5.2.1');
73 if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
74 $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
76 $RCI->fail('Version', 'PHP Version ' . MIN_PHP_VERSION . ' or greater is required ' . PHP_VERSION . ' detected');
80 <h3>Checking PHP extensions</h3>
81 <p class="hint">The following modules/extensions are <em>required</em> to run Roundcube:</p>
84 // get extensions location
85 $ext_dir = ini_get('extension_dir');
87 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
88 foreach ($required_php_exts as $name => $ext) {
89 if (extension_loaded($ext)) {
92 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
93 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
94 $RCI->fail($name, $msg, $source_urls[$name]);
101 <p class="hint">The next couple of extensions are <em>optional</em> and recommended to get the best performance:</p>
104 foreach ($optional_php_exts as $name => $ext) {
105 if (extension_loaded($ext)) {
109 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
110 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
111 $RCI->na($name, $msg, $source_urls[$name]);
119 <h3>Checking available databases</h3>
120 <p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p>
124 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
125 foreach ($supported_dbs as $database => $ext) {
126 if (extension_loaded($ext)) {
127 $RCI->pass($database);
130 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
131 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : 'Not installed';
132 $RCI->na($database, $msg, $source_urls[$database]);
140 <h3>Check for required 3rd party libs</h3>
141 <p class="hint">This also checks if the include path is set correctly.</p>
145 foreach ($required_libs as $classname => $file) {
147 if (class_exists($classname)) {
148 $RCI->pass($classname);
151 $RCI->fail($classname, "Failed to load $file", $source_urls[$classname]);
159 <h3>Checking php.ini/.htaccess settings</h3>
160 <p class="hint">The following settings are <em>required</em> to run Roundcube:</p>
164 foreach ($ini_checks as $var => $val) {
165 $status = ini_get($var);
166 if ($val === '-NOTEMPTY-') {
167 if (empty($status)) {
168 $RCI->fail($var, "cannot be empty and needs to be set");
175 if ($status == $val) {
178 $RCI->fail($var, "is '$status', should be '$val'");
184 <p class="hint">The following settings are <em>optional</em> and recommended:</p>
188 foreach ($optional_checks as $var => $val) {
189 $status = ini_get($var);
190 if ($val === '-NOTEMPTY-') {
191 if (empty($status)) {
192 $RCI->optfail($var, "Could be set");
199 if ($status == $val) {
202 $RCI->optfail($var, "is '$status', could be '$val'");
210 if ($RCI->failures) {
211 echo '<p class="warning">Sorry but your webserver does not meet the requirements for Roundcube!<br />
212 Please install the missing modules or fix the php.ini settings according to the above check results.<br />
213 Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>';
215 echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';