array(
'LABEL' => 'FireBird',
'SCHEMA' => 'firebird',
'MODULE' => 'interbase',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_remarks'
),
'mysql' => array(
'LABEL' => 'MySQL 3.x',
'SCHEMA' => 'mysql',
'MODULE' => 'mysql',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_remarks'
),
'mysql4' => array(
'LABEL' => 'MySQL 4.x',
'SCHEMA' => 'mysql',
'MODULE' => 'mysql',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_remarks'
),
'mssql' => array(
'LABEL' => 'MS SQL Server 7/2000',
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
'DELIM' => 'GO',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
),
'msaccess' => array(
'LABEL' => 'MS Access [ ODBC ]',
'SCHEMA' => '',
'MODULE' => 'odbc',
'DELIM' => '',
'DELIM_BASIC' => ';',
'COMMENTS' => ''
),
'mssql-odbc'=> array(
'LABEL' => 'MS SQL Server [ ODBC ]',
'SCHEMA' => 'mssql',
'MODULE' => 'odbc',
'DELIM' => 'GO',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
),
'oracle' => array(
'LABEL' => 'Oracle',
'SCHEMA' => 'oracle',
'MODULE' => 'oracle',
'DELIM' => '',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
),
'postgres' => array(
'LABEL' => 'PostgreSQL 7.x',
'SCHEMA' => 'postgres',
'MODULE' => 'pgsql',
'DELIM' => ';',
'DELIM_BASIC' => ';',
'COMMENTS' => 'remove_comments'
),
);
$suffix = ((defined('PHP_OS')) && (preg_match('#win#i', PHP_OS))) ? 'dll' : 'so';
// Try and load an appropriate language if required
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
{
$accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
foreach ($accept_lang_ary as $accept_lang)
{
// Set correct format ... guess full xx_YY form
$accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
{
$language = $accept_lang;
break;
}
else
{
// No match on xx_YY so try xx
$accept_lang = substr($accept_lang, 0, 2);
if (file_exists($phpbb_root_path . 'language/' . $accept_lang))
{
$language = $accept_lang;
break;
}
}
}
}
include($phpbb_root_path . 'language/' . $language . '/lang_main.'.$phpEx);
include($phpbb_root_path . 'language/' . $language . '/lang_admin.'.$phpEx);
// If we're upgrading include that script
if ($upgrade)
{
require('upgrade.' . $phpEx);
}
// Do the installation
if (isset($_POST['install']))
{
// Check for missing data
$var_ary = array(
'admin' => array('admin_name', 'admin_pass1', 'admin_pass2', 'board_email1', 'board_email2'),
'server' => array('server_name', 'server_port', 'script_path')
);
foreach ($var_ary as $var_type => $var_block)
{
foreach ($var_block as $var)
{
if (!$$var)
{
$error[$var_type][] = 'You must fill out all fields in this block';
break;
}
}
}
// Check the entered email address and password
if ($admin_pass1 != $admin_pass2 && $admin_pass1 != '')
{
$error['admin'][] = $lang['PASSWORD_MISMATCH'];
}
if ($board_email1 != $board_email2 && $board_email1 != '')
{
$error['admin'][] = $lang['INSTALL_EMAIL_MISMATCH'];
}
// Test the database connectivity
if (!@extension_loaded($available_dbms[$dbms]['MODULE']))
{
if (!@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'off' || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' || !@dl($available_dbms[$dbms]['MODULE'] . '.' . $suffix))
{
$error['db'][] = 'Cannot load the PHP module for the selected database type';
}
}
// Include the DB layer
include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
// Instantiate it and set return on error true
$db = new sql_db();
$db->sql_return_on_error(true);
// Try and connect ...
if (is_array($db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false)))
{
$db_error = $db->sql_error();
$error['db'][] = 'Could not connect to the database, error message returned:' . '
' . (($db_error['message']) ? $db_error['message'] : 'No error message given');
}
// No errors so lets do the twist
if (sizeof($error))
{
$stage = 1;
}
}
else if (isset($_POST['testdb']))
{
$stage = 1;
}
else if (isset($_POST['retest']))
{
$stage = 0;
}
else if (isset($_POST['dldone']))
{
// A minor fudge ... we're basically trying to see if the user uploaded
// their downloaded config file ... it's not worth IMO trying to
// open it and compare all the data. If a user wants to screw up this
// simple task ... well ... uhm
if (filesize($phpbb_root_path . 'config.'.$phpEx) < 10)
{
$stage = 3;
}
}
// First stage of installation
//
// Here we basically imform the user of any potential issues such as no database
// support, missing directories, etc. We also give some insight into "missing"
// modules which we'd quite like installed (but which are not essential)
if ($stage == 0)
{
$user->lang = array_merge($lang, array(
'DLL_firebird' => 'Firebird 1.5+',
'DLL_mysql' => 'MySQL 3.23.x',
'DLL_mysql4' => 'MySQL 4.x',
'DLL_mssql' => 'MSSQL Server 2000',
'DLL_mssql-odbc' => 'MSSQL Server 2000 via ODBC',
'DLL_msaccess' => 'MS Access via ODBC',
'DLL_oracle' => 'Oracle',
'DLL_postgres' => 'PostgreSQL 7.x')
);
// Test for DB modules
$dlls_db = array();
$passed['db'] = false;
foreach ($available_dbms as $db_name => $db_ary)
{
$dll = $db_ary['MODULE'];
if (!extension_loaded($dll))
{
if (!@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'off' || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' || !@dl($dll . ".$suffix"))
{
$dlls_db[$db_name] = '' . 'Unavailable' . '';
continue;
}
}
$dlls_db[$db_name] = '' . 'Available' . '';
$passed['db'] = true;
}
// Test for other modules
$dlls_other = array();
foreach ($php_dlls_other as $dll)
{
if (!extension_loaded($dll))
{
if (!@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'off' || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on' || !@dl($dll . ".$suffix"))
{
$dlls_other[$dll] = '' . 'Unavailable' . '';
continue;
}
}
$dlls_other[$dll] = '' . 'Available' . '';
}
inst_page_header($instruction_text, "install.$phpEx");
?>
Before proceeding with full installation phpBB will carry out some tests on your server and basic install. Please ensure you read through the results thoroughly and do not proceed until all tests are passed.
You must be running at least PHP 4.1.0 with support for at least one compatible database. If no support modules are shown as available you should contact your hosting provider or review the relevant PHP installation documentation for advice.
• PHP version >= 4.1.0: | No'; } else { echo 'Yes'; if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') { echo ', safe mode'; } echo ''; } ?> |
• Supported Databases: | $available) { echo ($i++ > 0) ? '|
lang['DLL_' . $dll]; ?> |
These modules or applications are optional, you do not need these to use phpBB 2.2. However if you do have them they will will enable greater functionality.
• lang['DLL_' . $dll]; ?>: | |
• Imagemagick support: | Available, ' . $imagemagick . '' : 'Cannot determine location'; ?> |
In order to function correctly phpBB needs to be able to access or write to certain files or directories. If you see "Does not exist" you need to create the relevant file or directory. If you see "Not writeable" you need to change the permissions on the file or directory to allow phpBB to write to it.
• |
These files, directories or permissions are optional. The installation routines will attempt to use various techniques to complete if they do not exist or cannot be written to. However, the presence of these files, directories or permissions will speed installation.
• |