diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index 81e6f36e1b..7a86f67bff 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -136,15 +136,15 @@
A webserver or web hosting account running on any major Operating System with support for PHP
A SQL database system, one of:
- - MySQL 3.23 or above (MySQLi supported)
- - PostgreSQL 7.3+
- - SQLite 2.8.2+
- - Firebird 2.0+
+ - MySQL(i): 4.1 or above
+ - PostgreSQL: 8.2+
+ - SQLite: 2.8.2+
+ - Firebird: 2.0+
- MS SQL Server 2000 or above (directly or via ODBC)
- - Oracle
+ - Oracle: 9.2+
- PHP 4.3.3+ (>=4.3.3, >4.4.x, >5.x.x, >6.0-dev (compatible)) with support for the database you intend to use.
+ PHP 5.2.0+ with support for the database you intend to use.
getimagesize() function need to be enabled.
These optional presence of the following modules within PHP will provide access to additional features, but they are not required.
diff --git a/phpBB/includes/core/core.php b/phpBB/includes/core/core.php
index 09b6365da2..36fef1fccc 100644
--- a/phpBB/includes/core/core.php
+++ b/phpBB/includes/core/core.php
@@ -100,6 +100,16 @@ abstract class phpbb
'installed' => false,
);
+ /**
+ * @var array Last notice occurred in message handler
+ */
+ public static $last_notice = array(
+ 'file' => '',
+ 'line' => 0,
+ 'message' => '',
+ 'errno' => E_NOTICE,
+ );
+
/**#@+
* Permission constant
*/
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 1f6e7bcae7..e304edee0c 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2006,18 +2006,27 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
{
global $msg_title, $msg_long_text;
- // Do not display notices if we suppress them via @
- if (error_reporting() == 0)
- {
- return;
- }
-
// Message handler is stripping text. In case we need it, we are able to define long text...
if (isset($msg_long_text) && $msg_long_text && !$msg_text)
{
$msg_text = $msg_long_text;
}
+ // Store information for later use
+ phpbb::$last_notice = array(
+ 'file' => $errfile,
+ 'line' => $errline,
+ 'message' => $msg_text,
+ 'php_error' => (!empty($php_errormsg)) ? $php_errormsg : '',
+ 'errno' => $errno,
+ );
+
+ // Do not display notices if we suppress them via @
+ if (error_reporting() == 0)
+ {
+ return;
+ }
+
switch ($errno)
{
case E_NOTICE:
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 16c10312ce..53be92ac14 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -70,8 +70,8 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_30
'3.0.x' => true,
),
'mssql_2005'=> array(
- 'LABEL' => 'MS SQL Server [ 2005 ]',
- 'MODULE' => 'sqlsrv',
+ 'LABEL' => 'MS SQL Server [ 2005/2008 ]',
+ 'MODULE' => array('sqlsrv', 'sqlsrv_ts'),
'DRIVER' => 'mssql_2005',
'AVAILABLE' => true,
'3.0.x' => true,
@@ -118,6 +118,8 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_30
}
}
+ $any_db_support = false;
+
// now perform some checks whether they are really available
foreach ($available_dbms as $db_name => $db_ary)
{
@@ -136,21 +138,34 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_30
$dll = $db_ary['MODULE'];
- if (!@extension_loaded($dll))
+ if (!is_array($dll))
{
- if (!can_load_dll($dll))
+ $dll = array($dll);
+ }
+
+ $is_available = false;
+ foreach ($dll as $test_dll)
+ {
+ if (@extension_loaded($test_dll) || can_load_dll($test_dll))
{
- if ($return_unavailable)
- {
- $available_dbms[$db_name]['AVAILABLE'] = false;
- }
- else
- {
- unset($available_dbms[$db_name]);
- }
- continue;
+ $is_available = true;
+ break;
}
}
+
+ if (!$is_available)
+ {
+ if ($return_unavailable)
+ {
+ $available_dbms[$db_name]['AVAILABLE'] = false;
+ }
+ else
+ {
+ unset($available_dbms[$db_name]);
+ }
+ continue;
+ }
+
$any_db_support = true;
}
@@ -343,21 +358,21 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
case 'mysql':
if (version_compare($db->sql_server_info(true), '4.1.3', '<'))
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_MYSQL'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_MYSQL_VERSION'];
}
break;
case 'mysqli':
if (version_compare($db->sql_server_info(true), '4.1.3', '<'))
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_MYSQLI'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_MYSQLI_VERSION'];
}
break;
case 'sqlite':
if (version_compare($db->sql_server_info(true), '2.8.2', '<'))
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_SQLITE'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_SQLITE_VERSION'];
}
break;
@@ -369,7 +384,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
preg_match('#V([\d.]+)#', $val, $match);
if ($match[1] < 2)
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_FIREBIRD'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_FIREBIRD_VERSION'];
}
$db_info = @ibase_db_info($db->service_handle, $dbname, IBASE_STS_HDR_PAGES);
@@ -383,9 +398,9 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
else
{
$sql = "SELECT *
- FROM RDB$FUNCTIONS
- WHERE RDB$SYSTEM_FLAG IS NULL
- AND RDB$FUNCTION_NAME = 'CHAR_LENGTH'";
+ FROM RDB\$FUNCTIONS
+ WHERE RDB\$SYSTEM_FLAG IS NULL
+ AND RDB\$FUNCTION_NAME = 'CHAR_LENGTH'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -393,7 +408,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
// if its a UDF, its too old
if ($row)
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_FIREBIRD'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_FIREBIRD_VERSION'];
}
else
{
@@ -402,7 +417,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
$result = $db->sql_query($sql);
if (!$result) // This can only fail if char_length is not defined
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_FIREBIRD'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_FIREBIRD_VERSION'];
}
$db->sql_freeresult($result);
}
@@ -456,7 +471,7 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
if (version_compare($stats['NLS_RDBMS_VERSION'], '9.2', '<'))
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_ORACLE'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_ORACLE_VERSION'];
}
if ($stats['NLS_CHARACTERSET'] !== 'AL32UTF8')
@@ -466,14 +481,22 @@ function connect_check_db($dbms_details, $table_prefix, $dbhost, $dbuser, $dbpas
break;
case 'postgres':
- $sql = "SHOW server_encoding;";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8')
+ if (version_compare($db->sql_server_info(true), '8.2', '<'))
{
- $error[] = phpbb::$user->lang['INST_ERR_DB_NO_POSTGRES'];
+ $error[] = phpbb::$user->lang['INST_ERR_DB_POSTGRES_VERSION'];
+ }
+ else
+ {
+ $sql = "SHOW server_encoding;";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8')
+ {
+ $error[] = phpbb::$user->lang['INST_ERR_DB_NO_POSTGRES_UTF8'];
+ }
}
break;
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 001acc4584..eb61be1f46 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -769,7 +769,8 @@ class install_install extends module
// Create a list of any PHP modules we wish to have loaded
$load_extensions = array();
$available_dbms = get_available_dbms($data['dbms']);
- $check_exts = array_merge(array($available_dbms[$data['dbms']]['MODULE']), $this->php_dlls_other);
+
+ $check_exts = array_merge($this->php_dlls_other);
foreach ($check_exts as $dll)
{
@@ -784,6 +785,37 @@ class install_install extends module
}
}
+ $db_module = $available_dbms[$data['dbms']]['MODULE'];
+
+ if (!is_array($db_module))
+ {
+ $db_module = array($db_module);
+ }
+
+ $load_dll = true;
+ foreach ($db_module as $dll)
+ {
+ if (@extension_loaded($dll))
+ {
+ $load_dll = false;
+ break;
+ }
+
+ if (!can_load_dll($dll))
+ {
+ $load_dll = false;
+ break;
+ }
+
+ $load_dll = true;
+ }
+
+ if ($load_dll)
+ {
+ $dll = current($db_module);
+ $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX;
+ }
+
// Create a lock file to indicate that there is an install in progress
$fp = @fopen(PHPBB_ROOT_PATH . 'cache/install_lock', 'wb');
if ($fp === false)
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index de117098e2..99b608e326 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -230,14 +230,15 @@ $lang = array_merge($lang, array(
'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
'INST_ERR_DB_NO_ERROR' => 'No error message given.',
- 'INST_ERR_DB_NO_MYSQL' => 'The version of MySQL installed on the target server must be at least 4.1, phpBB 3.1 cannot be installed on an older version.',
- 'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on the target server must be at least 4.1, phpBB 3.1 cannot be installed on an older version.',
- 'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
- 'INST_ERR_DB_NO_ORACLE' => 'The version of Oracle installed on the target server must be at least 9.2, phpBB 3.1 cannot be installed on an older version.',
- 'INST_ERR_DB_NO_ORACLE_NLS' => 'You must configure Oracle so that the NLS_CHARACTERSET parameter is set to ALU32UTF8.',
- 'INST_ERR_DB_NO_FIREBIRD' => 'The version of Firebird installed on this machine is older than 2.0, please upgrade to a newer version.',
- 'INST_ERR_DB_NO_FIREBIRD_PS'=> 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.',
- 'INST_ERR_DB_NO_POSTGRES' => 'The database you have selected was not created in UNICODE or UTF8 encoding. Try installing with a database in UNICODE or UTF8 encoding.',
+
+ 'INST_ERR_DB_MYSQL_VERSION' => 'The version of MySQL installed on the target server must be at least 4.1, phpBB 3.1 cannot be installed on an older version.',
+ 'INST_ERR_DB_SQLITE_VERSION' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
+ 'INST_ERR_DB_ORACLE_VERSION' => 'The version of Oracle installed on the target server must be at least 9.2, phpBB 3.1 cannot be installed on an older version.',
+ 'INST_ERR_DB_FIREBIRD_VERSION' => 'The version of Firebird installed on this machine is older than 2.0, please upgrade to a newer version.',
+ 'INST_ERR_DB_POSTGRES_VERSION' => 'The version of PostgreSQL installed on this machine is older than 8.2, please upgrade to a newer version.',
+ 'INST_ERR_DB_NO_ORACLE_NLS' => 'You must configure Oracle so that the NLS_CHARACTERSET parameter is set to ALU32UTF8.',
+ 'INST_ERR_DB_NO_FIREBIRD_PS' => 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.',
+ 'INST_ERR_DB_NO_POSTGRES_UTF8' => 'The database you have selected was not created in UNICODE or UTF8 encoding. Try installing with a database in UNICODE or UTF8 encoding.',
'INST_ERR_DB_NO_NAME' => 'No database name specified.',
'INST_ERR_EMAIL_INVALID' => 'The e-mail address you entered is invalid.',
'INST_ERR_EMAIL_MISMATCH' => 'The e-mails you entered did not match.',