I develop a website site based on CodeIgniter, the latest version 2.2.1 and I installed a PhPBB forum (version 3.1.3).
I would like to use the functions of the forum on my web site (like the connection/profile etc.). I've looked on this site : http://www.3cc.org/blog/2010/03/integrating-your-existing-site-into-phpbb3/ to simply display my pseudo.
My Controller is just a copy/paste of the first paragraph
class Forum_test extends CI_Controller{
function __construct()
{
parent::__construct();
}
function index()
{
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
}
}
And my problem is when I try to use this code, I have the following error
Fatal error: Call to a member function header() on a non-object in /var/www/forum/phpbb/session.php on line 224
But if I create a simple document with only
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
It works (I don't have any error)
Do you have any idea of what is wrong with my code ?
Thank you.