1 <form action="index.php" method="get">
4 $required_php_exts = array('PCRE' => 'pcre', 'Session' => 'session', 'Sockets' => 'sockets');
6 $optional_php_exts = array('FileInfo' => 'fileinfo', 'Libiconv' => 'iconv',
7 'Multibyte' => 'mbstring', 'OpenSSL' => 'openssl', 'Mcrypt' => 'mcrypt', 'GD' => 'gd');
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');
12 $supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli',
13 'PostgreSQL' => 'pgsql', 'SQLite (v2)' => 'sqlite');
15 $ini_checks = array('file_uploads' => 1, 'session.auto_start' => 0,
16 'magic_quotes_gpc' => 0, 'magic_quotes_sybase' => 0);
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',
25 'Mcrypt' => 'http://www.php.net/manual/en/ref.mcrypt.php',
26 'OpenSSL' => 'http://www.php.net/manual/en/ref.openssl.php',
27 'GD' => 'http://www.php.net/manual/en/ref.image.php',
28 'PEAR' => 'http://pear.php.net',
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'
34 echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />';
37 <h3>Checking PHP version</h3>
40 if (phpversion() > 4.3) {
41 $RCI->pass('Version', 'PHP ' . phpversion() . ' detected');
44 $RCI->fail('Version', 'PHP Version 4.3.1 or greater is required');
49 <h3>Checking PHP extensions</h3>
50 <p class="hint">The following modules/extensions are <em>required</em> to run RoundCube:</p>
53 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
54 foreach ($required_php_exts AS $name => $ext) {
55 if (extension_loaded($ext)) {
59 $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
60 $msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : '';
61 $RCI->fail($name, $msg, $source_urls[$name]);
68 <p class="hint">These extensions are <em>optional</em> but recommended to get the best performance:</p>
71 foreach ($optional_php_exts AS $name => $ext) {
72 if (extension_loaded($ext)) {
76 $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
77 $msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : '';
78 $RCI->na($name, $msg, $source_urls[$name]);
86 <h3>Checking available databases</h3>
87 <p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p>
91 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
92 foreach ($supported_dbs AS $database => $ext) {
93 if (extension_loaded($ext)) {
94 $RCI->pass($database);
97 $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
98 $msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : 'Not installed';
99 $RCI->na($database, $msg, $source_urls[$database]);
107 <h3>Check for required 3rd party libs</h3>
108 <p class="hint">This also checks if the include path is set correctly.</p>
112 foreach ($required_libs as $classname => $file) {
114 if (class_exists($classname)) {
115 $RCI->pass($classname);
117 else if ($classname == 'DB' || ($classname == 'MDB2' && class_exists('DB'))) {
118 $RCI->na($classname, 'Use ' . ($classname == 'DB' ? 'MDB2' : 'DB') . ' instead');
121 $RCI->fail($classname, "Failed to load $file", $source_urls[$classname]);
129 <h3>Checking php.ini/.htaccess settings</h3>
133 foreach ($ini_checks as $var => $val) {
134 $status = ini_get($var);
135 if ($status == $val) {
139 $RCI->fail($var, "is '$status', should be '$val'");
147 if ($RCI->failures) {
148 echo '<p class="warning">Sorry but your webserver does not meet the requirements for RoundCube!<br />
149 Please install the missing modules or fix the php.ini settings according to the above check results.<br />
150 Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>';
152 echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';