Page 1 of 1

Path problem after moving from one directory to another

Posted: Sun Jul 13, 2008 10:53 pm
by Bono007
In FAQ it says:
After verifying the settings in the ACP, you can delete the install directory to enable the board. The board will stay disabled until you do so.

Once you are pleased with your new installation you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems - but you may still want to check your cookie settings within the administration panel, if the cookie path need to be adjusted prior to renaming.
I have renamed directory from phpBB3 to forum, and updated script path accordingly. But when i try to post reply in older imported topic i get this:
Fatal error: Cannot redeclare class bbcode in /home/www/public_html/phpBB3/includes/bbcode.php on line 23
Where is forum pulling that old path? I checked config and mysql database and i can't find where to change path to look into forum directory and not phpBB3 directory.

I have tried to clear cache also.
On imported topics it throws that error but if i create new topic and post reply everything works.

Re: Path problem after moving from one directory to another

Posted: Mon Jul 14, 2008 3:04 am
by D¡cky
That does look like a cache problem. Empty the cache with your ftp program or your hosting control panel file manager. Delete everything except for .htaccess and index.htm.

Re: Path problem after moving from one directory to another

Posted: Mon Jul 14, 2008 9:24 am
by Bono007
I have tried that no luck. It is shame that in config you cannot put manually absolute path so this kind of thing do not happen.
I did clean install again but this time from right directory and everything works fine, shame i have lost 5 hours checking database and files if i can find path that is entered somewhere in there.

Thanks anyway

Re: Path problem after moving from one directory to another

Posted: Sat Jul 26, 2008 8:15 am
by `checho`
I also have the same problem after moving my board from one directoy to another. I edited in the database phpbb_config -> script_url and the cookie stuff for the new URL but there are still some traces of the old URL somewhere. I see the error message on almost every try to reply to a topic.

Fatal error: Cannot redeclare class bbcode in /var/www/old/includes/bbcode.php on line 0
where the displayed path to bbcode.php is still the old one before the board was moved.

I am thinking of making a database backup and a fresh installation of phpBB in the new directory, and then importing the database back in place of the one that was newly created by the fresh installation. But if the trace to the old URL is somewhere in the database I would not help myself I guess.

Any help is appreciated.
Thanks.

Re: Path problem after moving from one directory to another

Posted: Mon Mar 22, 2010 10:21 pm
by tomekst
I had the same problem.

I fixed it as follows:

In includes/functions_posting.php function topic_review I changed:

Code: Select all

	
// Instantiate BBCode class
	if (!isset($bbcode) && $bbcode_bitfield !== '')
	{
		include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
		$bbcode = new bbcode(base64_encode($bbcode_bitfield));				
	}
for

Code: Select all

	
// Instantiate BBCode class
	if (!isset($bbcode) && $bbcode_bitfield !== '')
	{
		if (!class_exists('bbcode'))
		{
			include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
		}
		$bbcode = new bbcode(base64_encode($bbcode_bitfield));				
	}
I hope I helped