1 <form action="index.php" method="get">
4 $required_php_exts = array('PCRE' => 'pcre', 'DOM' => 'dom',
5 'Session' => 'session', 'XML' => 'xml');
7 $optional_php_exts = array('FileInfo' => 'fileinfo', 'Libiconv' => 'iconv',
8 'Multibyte' => 'mbstring', 'OpenSSL' => 'openssl', 'Mcrypt' => 'mcrypt',
11 $required_libs = array('PEAR' => 'PEAR.php', 'MDB2' => 'MDB2.php',
12 'Net_SMTP' => 'Net/SMTP.php', 'Mail_mime' => 'Mail/mime.php',
13 'iilConnection' => 'lib/imap.inc');
15 $supported_dbs = array('MySQL' => 'mysql', 'MySQLi' => 'mysqli',
16 'PostgreSQL' => 'pgsql', 'SQLite (v2)' => 'sqlite');
18 $ini_checks = array('file_uploads' => 1, 'session.auto_start' => 0,
19 'zend.ze1_compatibility_mode' => 0, 'mbstring.func_overload' => 0,
20 'suhosin.session.encrypt' => 0);
22 $optional_checks = array('date.timezone' => '-NOTEMPTY-');
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',
31 'Mcrypt' => 'http://www.php.net/manual/en/ref.mcrypt.php',
32 'OpenSSL' => 'http://www.php.net/manual/en/ref.openssl.php',
33 'GD' => 'http://www.php.net/manual/en/ref.image.php',
34 'PEAR' => 'http://pear.php.net',
35 'MDB2' => 'http://pear.php.net/package/MDB2',
36 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP',
37 'Mail_mime' => 'http://pear.php.net/package/Mail_mime',
38 'DOM' => 'http://www.php.net/manual/en/intro.dom.php'
41 echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />';
44 <h3>Checking PHP version</h3>
47 define('MIN_PHP_VERSION', '5.2.0');
48 if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
49 $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
51 $RCI->fail('Version', 'PHP Version ' . MIN_PHP_VERSION . ' or greater is required ' . PHP_VERSION . ' detected');
55 <h3>Checking PHP extensions</h3>
56 <p class="hint">The following modules/extensions are <em>required</em> to run RoundCube:</p>
59 // get extensions location
60 $ext_dir = ini_get('extension_dir');
62 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
63 foreach ($required_php_exts AS $name => $ext) {
64 if (extension_loaded($ext)) {
67 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
68 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
69 $RCI->fail($name, $msg, $source_urls[$name]);
76 <p class="hint">The next couple of extensions are <em>optional</em> and recommended to get the best performance:</p>
79 foreach ($optional_php_exts AS $name => $ext) {
80 if (extension_loaded($ext)) {
84 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
85 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
86 $RCI->na($name, $msg, $source_urls[$name]);
94 <h3>Checking available databases</h3>
95 <p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p>
99 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
100 foreach ($supported_dbs AS $database => $ext) {
101 if (extension_loaded($ext)) {
102 $RCI->pass($database);
105 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
106 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : 'Not installed';
107 $RCI->na($database, $msg, $source_urls[$database]);
115 <h3>Check for required 3rd party libs</h3>
116 <p class="hint">This also checks if the include path is set correctly.</p>
120 foreach ($required_libs as $classname => $file) {
122 if (class_exists($classname)) {
123 $RCI->pass($classname);
126 $RCI->fail($classname, "Failed to load $file", $source_urls[$classname]);
134 <h3>Checking php.ini/.htaccess settings</h3>
135 <p class="hint">The following settings are <em>required</em> to run RoundCube:</p>
139 foreach ($ini_checks as $var => $val) {
140 $status = ini_get($var);
141 if ($val === '-NOTEMPTY-') {
142 if (empty($status)) {
143 $RCI->fail($var, "cannot be empty and needs to be set");
150 if ($status == $val) {
153 $RCI->fail($var, "is '$status', should be '$val'");
159 <p class="hint">The following settings are <em>optional</em> and recommended:</p>
163 foreach ($optional_checks as $var => $val) {
164 $status = ini_get($var);
165 if ($val === '-NOTEMPTY-') {
166 if (empty($status)) {
167 $RCI->optfail($var, "Could be set");
174 if ($status == $val) {
177 $RCI->optfail($var, "is '$status', could be '$val'");
185 if ($RCI->failures) {
186 echo '<p class="warning">Sorry but your webserver does not meet the requirements for RoundCube!<br />
187 Please install the missing modules or fix the php.ini settings according to the above check results.<br />
188 Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>';
190 echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';