1 <form action="index.php" method="get">
4 $required_php_exts = array('PCRE' => 'pcre', 'DOM' => 'dom', 'Session' => 'session');
6 $optional_php_exts = array('FileInfo' => 'fileinfo', 'Libiconv' => 'iconv',
7 'Multibyte' => 'mbstring', 'OpenSSL' => 'openssl', 'Mcrypt' => 'mcrypt',
10 $required_libs = array('PEAR' => 'PEAR.php', 'MDB2' => 'MDB2.php',
11 'Net_SMTP' => 'Net/SMTP.php', 'Mail_mime' => 'Mail/mime.php',
12 'iilConnection' => 'lib/imap.inc');
14 $supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli',
15 'PostgreSQL' => 'pgsql', 'SQLite (v2)' => 'sqlite');
17 $ini_checks = array('file_uploads' => 1, 'session.auto_start' => 0,
18 'zend.ze1_compatibility_mode' => 0, 'mbstring.func_overload' => 0);
21 'Sockets' => 'http://www.php.net/manual/en/ref.sockets.php',
22 'Session' => 'http://www.php.net/manual/en/ref.session.php',
23 'PCRE' => 'http://www.php.net/manual/en/ref.pcre.php',
24 'FileInfo' => 'http://www.php.net/manual/en/ref.fileinfo.php',
25 'Libiconv' => 'http://www.php.net/manual/en/ref.iconv.php',
26 'Multibyte' => 'http://www.php.net/manual/en/ref.mbstring.php',
27 'Mcrypt' => 'http://www.php.net/manual/en/ref.mcrypt.php',
28 'OpenSSL' => 'http://www.php.net/manual/en/ref.openssl.php',
29 'GD' => 'http://www.php.net/manual/en/ref.image.php',
30 'PEAR' => 'http://pear.php.net',
31 'MDB2' => 'http://pear.php.net/package/MDB2',
32 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP',
33 'Mail_mime' => 'http://pear.php.net/package/Mail_mime',
34 'DOM' => 'http://www.php.net/manual/en/intro.dom.php'
37 echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />';
40 <h3>Checking PHP version</h3>
43 define('MIN_PHP_VERSION', '5.2.0');
44 if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
45 $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
47 $RCI->fail('Version', 'PHP Version ' . MIN_PHP_VERSION . ' or greater is required ' . PHP_VERSION . ' detected');
51 <h3>Checking PHP extensions</h3>
52 <p class="hint">The following modules/extensions are <em>required</em> to run RoundCube:</p>
55 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
56 foreach ($required_php_exts AS $name => $ext) {
57 if (extension_loaded($ext)) {
60 $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
61 $msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : '';
62 $RCI->fail($name, $msg, $source_urls[$name]);
69 <p class="hint">The next couple of extensions are <em>optional</em> but recommended to get the best performance:</p>
72 foreach ($optional_php_exts AS $name => $ext) {
73 if (extension_loaded($ext)) {
77 $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
78 $msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : '';
79 $RCI->na($name, $msg, $source_urls[$name]);
87 <h3>Checking available databases</h3>
88 <p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p>
92 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
93 foreach ($supported_dbs AS $database => $ext) {
94 if (extension_loaded($ext)) {
95 $RCI->pass($database);
98 $_ext = $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
99 $msg = @dl($_ext) ? 'Could be loaded. Please add in php.ini' : 'Not installed';
100 $RCI->na($database, $msg, $source_urls[$database]);
108 <h3>Check for required 3rd party libs</h3>
109 <p class="hint">This also checks if the include path is set correctly.</p>
113 foreach ($required_libs as $classname => $file) {
115 if (class_exists($classname)) {
116 $RCI->pass($classname);
119 $RCI->fail($classname, "Failed to load $file", $source_urls[$classname]);
127 <h3>Checking php.ini/.htaccess settings</h3>
131 foreach ($ini_checks as $var => $val) {
132 $status = ini_get($var);
133 if ($status == $val) {
137 $RCI->fail($var, "is '$status', should be '$val'");
145 if ($RCI->failures) {
146 echo '<p class="warning">Sorry but your webserver does not meet the requirements for RoundCube!<br />
147 Please install the missing modules or fix the php.ini settings according to the above check results.<br />
148 Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>';
150 echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';