2010-06-21, 10:23 PM
I have MyBB 1.4.13. I do not install it on a desktop PC, but on my phone.
My phone's server: PHP 5.2.2, MySQL 5.0.67. I am not going to use it as a server, just to test when i am not home, but mybb seems to be unable to install..
I get to the last step(and i mean the last). And after "Bulding administrator permissions....done"
I get an error: MyBB experienced an internal SQL error and cannot continue.
I think the problem comes from this code onwards
And more specificaly, the shutdown function(or maybe cache? ). Can someone help?
My phone's server: PHP 5.2.2, MySQL 5.0.67. I am not going to use it as a server, just to test when i am not home, but mybb seems to be unable to install..
I get to the last step(and i mean the last). And after "Bulding administrator permissions....done"
I get an error: MyBB experienced an internal SQL error and cannot continue.
I think the problem comes from this code onwards
// Automatic Login
my_unsetcookie("sid");
my_unsetcookie("mybbuser");
my_setcookie('mybbuser', $uid.'_'.$loginkey, null, true);
ob_end_flush();
// Make fulltext columns if supported
if($db->supports_fulltext('threads'))
{
$db->create_fulltext_index('threads', 'subject');
}
if($db->supports_fulltext_boolean('posts'))
{
$db->create_fulltext_index('posts', 'message');
}
// Register a shutdown function which actually tests if this functionality is working
add_shutdown('test_shutdown_function');
echo $lang->done_step_cachebuilding;
require_once MYBB_ROOT.'inc/class_datacache.php';
$cache = new datacache;
$cache->update_version();
$cache->update_attachtypes();
$cache->update_smilies();
$cache->update_badwords();
$cache->update_usergroups();
$cache->update_forumpermissions();
$cache->update_stats();
$cache->update_forums();
$cache->update_moderators();
$cache->update_usertitles();
$cache->update_reportedposts();
$cache->update_mycode();
$cache->update_posticons();
$cache->update_update_check();
$cache->update_tasks();
$cache->update_spiders();
$cache->update_bannedips();
$cache->update_banned();
$cache->update_birthdays();
$cache->update("plugins", array());
$cache->update("internal_settings", array('encryption_key' => random_str(32)));
echo $lang->done . '</p>';
echo $lang->done_step_success;
$written = 0;
if(is_writable('./'))
{
$lock = @fopen('./lock', 'w');
$written = @fwrite($lock, '1');
@fclose($lock);
if($written)
{
echo $lang->done_step_locked;
}
}
if(!$written)
{
echo $lang->done_step_dirdelete;
}
echo $lang->done_subscribe_mailing;
$output->print_footer('');
}
function db_connection($config)
{
require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php";
switch($config['database']['type'])
{
case "sqlite3":
$db = new DB_SQLite3;
break;
case "sqlite2":
$db = new DB_SQLite2;
break;
case "pgsql":
$db = new DB_PgSQL;
break;
case "mysqli":
$db = new DB_MySQLi;
break;
default:
$db = new DB_MySQL;
}
// Connect to Database
define('TABLE_PREFIX', $config['database']['table_prefix']);
$db->connect($config['database']);
$db->set_table_prefix(TABLE_PREFIX);
$db->type = $config['database']['type'];
return $db;
}
function error_list($array)
{
$string = "<ul>\n";
foreach($array as $error)
{
$string .= "<li>{$error}</li>\n";
}
$string .= "</ul>\n";
return $string;
}
function write_settings()
{
global $db;
$query = $db->simple_select('settings', '*', '', array('order_by' => 'title'));
while($setting = $db->fetch_array($query))
{
$setting['value'] = str_replace("\"", "\\\"", $setting['value']);
$settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n";
}
if(!empty($settings))
{
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n{$settings}\n?>";
$file = fopen(MYBB_ROOT."inc/settings.php", "w");
fwrite($file, $settings);
fclose($file);
}
}
function test_shutdown_function()
{
global $db;
$db->update_query("settings", array('value' => 1), "name='useshutdownfunc'");
write_settings();
}
And more specificaly, the shutdown function(or maybe cache? ). Can someone help?