Firefox PHP

Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....

Posted by Metalixia 
Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 24, 2006 10:56AM
Hiya, I've been using Phorum for about 3 years, and I love it.

Recently, I migrated my content to another server, and I now get the following message if I try to view a page whilst not logged in:

Fatal error: Cannot redeclare addgetpostvars() in /var/www/XXXXXXXXXXXXXXXXX/devega/htdocs/board/common.php on line 7

My message board is here: [www.sega-devega.net]

Could someone spread some light over this issue?

Thanks,

Lewis
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 24, 2006 11:20AM
I think some part of your page is loading common.php for a second time. If you change all include statements that include the common.php script to use include_once("./common.php"), the problem should not occur in that case.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 24, 2006 12:37PM
Mm... that doesn't seem to fix it.

Do you have any other idea has to how I can make it work? Would you like to take a look at the files yourself?
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 24, 2006 01:09PM
Not really (Phorum 3 is officially no longer supported and there's more than enough work to do for Phorum 5 already). The problem simply is that somehow the function addgetpostvars() is defined twice. It's either because common.php is loaded twice or because the function definition is in two different files. You should be able to find the spot where one of these two occurs by searching through the files.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 24, 2006 05:10PM
When I try to comment out the function, it gives the same error for the next function.

I haven't changed any of the files, i've only copied them to another server.
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 24, 2006 05:34PM
Sure, ... but we did not change those files either ;)

Still something apparently is reloading that common.php file. If you change all occurances of include("./common.php") to include_once("./common.php") it should work. If not, then you missed a spot (maybe require is used instead of include) or your PHP is somehow broken.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 25, 2006 10:04PM
Most of the scripts use "require" instead of "include". Should I change these to "include_once"?
Re: Fatal error: Fatal error: Cannot redeclare addgetpostvars() in ....
February 26, 2006 01:00AM
Yes.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, you do not have permission to post/reply in this forum.