• 0

phpbb3 issue


Question

i'm trying to move a phpbb3 install from one domain to another.

i moved ALL the files, i transferred the database, made the new user to the new db.

and i supposedly set "config.php" correctly.

although posting a copy of it might not do any good... (obvious text altered)

<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysqli';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'new_db';
$dbuser = '"new user';
$dbpasswd = 'correct pw';
$table_prefix = 'phpbb_';
$acm_type = 'file';
$load_extensions = '';

@define('PHPBB_INSTALLED', true);
//@define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
?>

and when i try to load the forums i get this:

General Error

SQL ERROR [ mysqli ]

Access denied for user 'new_user'@'localhost' to database 'new_db' [1044]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

the batabase backup was 115kb (gzipped) and 1.24mb normally.

did i miss a step or do something wrong?

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

For your database and username did you set it to "hostingwebsitename_database" and "hostingwebsitename_username"? Assuming that you are doing this on a shared server.

Link to comment
Share on other sites

  • 0

<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysqli';
$dbhost = 'localhost';
$dbport = '3306';
$dbname = 'sonceclan_black';
$dbuser = 'soneclan_formrum';
$dbpasswd = '*****';
$table_prefix = 'phpbb_';
$acm_type = 'file';
$load_extensions = '';

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
?>

that is the entire config file as it is.

i made the backup via the ACP in the phpbb3 install, then i made a new mysql database, and imported the database via phpmyadmin

i made the new user, gave it all permissions, and triple-checked the password. a.k.a. i re-did it 3 times.

i also transfered all the files to the new directory.

Link to comment
Share on other sites

  • 0

nah, but there was a typo, there was a "c" where it didn't belong. "'sonceclan_black'"

Parse error: syntax error, unexpected $end in /home2/soneclan/public_html/offspan/forum/includes/auth/auth_jfusion.php on line 46

this is the new error, where do i go to fix it?

or should i just uninstall all mods, then re-do the transfer?

Link to comment
Share on other sites

  • 0

<?php

/**
 *
 * PHP version 5
 *
 * @category   JFusion
 * @package    JFusionPlugins
 * @subpackage phpBB3
 * @author     JFusion Team <webmaster@jfusion.org>
 * @copyright  2008 JFusion. All rights reserved.
 * @license    http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link       http://www.jfusion.org
 */

/**
 * @ignore
 */
if (!defined('IN_PHPBB')) {
    exit;
}


//options
define('FORCE_REDIRECT_AFTER_LOGIN', 0);  //set this to one if you are getting a blank page after the user logs in
define('FORCE_REDIRECT_AFTER_LOGOUT', 0);  //set this to one if you are getting a blank page after the user logs out


/**
 * Login function
 */
function login_jfusion(&$username, &$password) {
    require_once 'auth_db.php';
    $result = login_db($username, $password);
    //check to see if login succesful and jFusion is not active
    global $JFusionActive, $phpbb_root_path, $phpEx, $db, $user;
    if ($result['status'] == LOGIN_SUCCESS && empty($JFusionActive)) {
        $mainframe = startJoomla();
        //define that the phpBB3 JFusion plugin needs to be excluded
        global $JFusionActivePlugin;
        $JFusionActivePlugin ='phpbb3';
        // do the login
        $credentials = array('username' => $username, 'password' => $password);
        $options = array('entry_url' => JURI::root() . 'index.php?option=com_user&task=login', 'silent' => true);

        //detect if the session should be remembered
        if (!empty($_POST['autologin'])) {
            $options['remember'] = 1;
        } else {
            $options['remember'] = 0;
        }

        $mainframe->login($credentials, $options);

        //clean up the joomla session object before continuing
        $session = & JFactory::getSession();
        $id = $session->getId();
        $session_data = session_encode();
        $session->close();

        //if we are not frameless, then we need to manually update the session data as on some servers, this data is getting corrupted
        //by php's session_write_close and thus the user is not logged into Joomla.  php bug?
        if (!defined('IN_JOOMLA')) {
            $session_table = & JTable::getInstance('session');
            if ($session_table->load($id)) {
                $session_table->data = $session_data;
                $session_table->store();
            } else {
                // if load failed then we assume that it is because
                // the session doesn't exist in the database
                // therefore we use insert instead of store
                $app = &JFactory::getApplication();
                $session_table->data = $session_data;
                $session_table->insert($id, $app->getClientId());
            }
        }


        if (FORCE_REDIRECT_AFTER_LOGIN) {
            if (isset($_REQUEST['redirect']) && defined('IN_JOOMLA')) {
                $itemid = JRequest::getInt('Itemid');
                $url = JFusionFunction::getPluginURL($itemid, false);
                $redirect = str_replace('./', '', $_REQUEST['redirect']);
                if (strpos($redirect, 'mode=login') !== false) {
                    $redirect = 'index.php';
                }
                $redirect = str_replace('?', '&', $redirect);
                $redirect = $url . "&jfile=" . $redirect;
            } else {
                    //redirect to prevent fatal errors on some servers
                    $uri = & JURI::getInstance();
                    //remove sid from URL
                    $query = $uri->getQuery(true);
                    if (isset($query['sid'])) {
                        unset($query['sid']);
                    }
                    $uri->setQuery($query);
                    //add a variable to ensure refresh
                    $redirect = $uri->toString();
            }

            //recreate phpBB's database connection
            include $phpbb_root_path . 'config.' . $phpEx;
            $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
            unset($dbpasswd);

            //create phpBB's user session
            $user->session_create($result['user_row']['user_id'], 0, $options['remember']);

            $url = str_replace('&', '&', $redirect);

            header("Location: $url");
            exit();
        } else {
            //recreate phpBB's database connection
            include $phpbb_root_path . 'config.' . $phpEx;
            $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
            unset($dbpasswd);
        }
    }

    return $result;
}
function logout_jfusion(&$data) {
    //check to see if JFusion is not active
    global $JFusionActive, $db, $user, $phpbb_root_path, $phpEx;
    if (empty($JFusionActive)) {
        //define that the phpBB3 JFusion plugin needs to be excluded
        global $JFusionActivePlugin;
        $JFusionActivePlugin ='phpbb3';
        $mainframe = startJoomla();
        // logout any joomla users
        $mainframe->logout();

        // clean up session
        $session = & JFactory::getSession();
        $session->close();

        if (FORCE_REDIRECT_AFTER_LOGOUT) {
            //redirect to prevent fatal errors on some servers
            $uri = & JURI::getInstance();
            //remove sid from URL
            $query = $uri->getQuery(true);
            if (isset($query['sid'])) {
                unset($query['sid']);
            }
            $uri->setQuery($query);
            //add a variable to ensure refresh
            $link = $uri->toString();
        }

        //recreate phpBB's database connection
        include $phpbb_root_path . 'config.' . $phpEx;
        $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
        unset($dbpasswd);

        if (FORCE_REDIRECT_AFTER_LOGOUT) {
            //clear the session
            if ($data['user_id'] != ANONYMOUS)
            {
                // Delete existing session, update last visit info first!
                if (!isset($data['session_time']))
                {
                    $data['session_time'] = time();
                }

                $sql = 'UPDATE ' . USERS_TABLE . '
                    SET user_lastvisit = ' . (int) $data['session_time'] . '
                    WHERE user_id = ' . (int) $data['user_id'];
                $db->sql_query($sql);

                if ($user->cookie_data['k'])
                {
                    $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
                        WHERE user_id = ' . (int) $data['user_id'] . "
                            AND key_id = '" . $db->sql_escape(md5($user->cookie_data['k'])) . "'";
                    $db->sql_query($sql);
                }

                // Reset the data array
                $data = array();

                $sql = 'SELECT *
                    FROM ' . USERS_TABLE . '
                    WHERE user_id = ' . ANONYMOUS;
                $result = $db->sql_query($sql);
                $data = $db->sql_fetchrow($result);
                $db->sql_freeresult($result);
            }

            $cookie_expire = $user->time_now - 31536000;
            $user->set_cookie('u', '', $cookie_expire);
            $user->set_cookie('k', '', $cookie_expire);
            $user->set_cookie('sid', '', $cookie_expire);
            unset($cookie_expire);

            header("Location: $link");
            exit();
        }
    }
}
function startJoomla() {
    if (!defined('_JEXEC')) {
        global $phpbb_root_path;
        // trick joomla into thinking we're running through joomla
        define('_JEXEC', true);
        define('DS', DIRECTORY_SEPARATOR);
        define('JPATH_BASE','/home/officin0/public_html');
        // load joomla libraries
        require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php';
        require_once JPATH_LIBRARIES . DS . 'loader.php';
        jimport('joomla.base.object');
        jimport('joomla.factory');
        jimport('joomla.filter.filterinput');
        jimport('joomla.error.error');
        jimport('joomla.event.dispatcher');
        jimport('joomla.event.plugin');
        jimport('joomla.plugin.helper');
        jimport('joomla.utilities.arrayhelper');
        jimport('joomla.environment.uri');
        jimport('joomla.environment.request');
        jimport('joomla.user.user');
        jimport('joomla.html.parameter');
        // JText cannot be loaded with jimport since it's not in a file called text.php but in methods
        JLoader::register('JText', JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'methods.php');
        JLoader::register('JRoute', JPATH_BASE . DS . 'libraries' . DS . 'joomla' . DS . 'methods.php');
        //load JFusion's libraries
        require_once JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_jfusion' . DS  . 'models' . DS . 'model.factory.php';
        require_once JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_jfusion' . DS  . 'models' . DS . 'model.jfusion.php';
    } else {
        define('IN_JOOMLA', 1);
        //make sure that Joomla's database is the current connection if we are in Joomla to prevent problems
        JFusionFunction::reconnectJoomlaDb();
    }

    $mainframe = & JFactory::getApplication('site');
    $GLOBALS['mainframe'] = & $mainframe;
    return $mainframe;
}

Did you follow this?

http://www.phpbb.com/kb/article/transferring-your-board-to-a-new-host-or-domain/

Especially, Preparing Your Board . . .

yes, i followed that

Link to comment
Share on other sites

  • 0

I've had problems with some plugins using their own path, such as keeping the old path after the move, and have to manually change the path. That's for Joomla at least. I've never transferred a PHPBB3 board.

Is this your old path: define('JPATH_BASE','/home/officin0/public_html');

That might just relate to Joomla and not your problem. It just seems odd.

I'm not sure if the database would have directory information or not. I've had to change domain information directly in the database before also. Only once though. Can't remember what that was for. Moodle maybe?

Link to comment
Share on other sites

  • 0

alright, so i'll try defining the new path.

i removed that file and went on, but hopefully this will fix it and i can put it back in, thanks.

i got it to load after some theme issues, now all that seems to be left is the lines of error above my headers, if any of these come to you,

lemme know, otherwise i'll just fix them all one by one.

[phpBB Debug] PHP Notice: in file /includes/session.php on line 542: include_once(./includes/auth/auth_jfusion.php) [function.include-once]: failed to open stream: No such file or directory
[phpBB Debug] PHP Notice: in file /includes/session.php on line 542: include_once() [function.include]: Failed opening './includes/auth/auth_jfusion.php' for inclusion (include_path='.:/usr/lib64/php:/usr/lib/php')
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1024: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)

Warning: Cannot modify header information - headers already sent by (output started at /home2/soneclan/public_html/offspan/forum/includes/functions.php:3706) in /home2/soneclan/public_html/offspan/forum/includes/functions.php on line 4505

Warning: Cannot modify header information - headers already sent by (output started at /home2/soneclan/public_html/offspan/forum/includes/functions.php:3706) in /home2/soneclan/public_html/offspan/forum/includes/functions.php on line 4507

Warning: Cannot modify header information - headers already sent by (output started at /home2/soneclan/public_html/offspan/forum/includes/functions.php:3706) in /home2/soneclan/public_html/offspan/forum/includes/functions.php on line 4508

Warning: Cannot modify header information - headers already sent by (output started at /

thanks for any continued help.

Link to comment
Share on other sites

  • 0

---------------------------------------------

all problems fixed.

thanks for jumping to help me ^_^

you guys really did help.

[Edit]

actually, one more thing apparently.

General Error

Authentication method not found

i guarentee you i can't solve that one

Link to comment
Share on other sites

  • 0

why, tyvm.

though i did run across 1 final issue:

General Error

Authentication method not found

this is when i try to login.

guess i posted a little too fast xD

i actually don't know that one.

Link to comment
Share on other sites

  • 0

I would think there would be a way. Have you tried removing the JFusion folder? I'm sure it's probably not that simple, but worth a try. I can't find any information on it. You might be better off asking in their forums.

Link to comment
Share on other sites

  • 0

alright, for those of you who were wondering, there were 2 ways i could have fixed this.

though i may mav figured this out faster if i went to the jfusion forums, and i never did.

1. i could have gone back, disable jfusion, and the plugin, and redo the file transfers. which i did.

or

2. i could have directed jfusion to the new domain, and then disabled the plugin, which would have been much easier, and i did not do.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.