MyBB Community Forums

Full Version: Error when attempting to activate several mods
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

Let me start off with saying how much I enjoy working with myBB. I came from admin a VB site and find MyBB to be 100x easier to setup, maintain and even fix than VB. I'm a definate convert. That being said I am having an issue when attempting to install and activate several plugins. I am ASSuming that there is a root problem as the error is the same and as I said is with several plugins. Others have installed just fine.

The main message is this:

 Attempting to activate:
Fatal error: Cannot redeclare find_replace_templatesets() (previously declared in /*/htdocs/forums/inc/adminfunctions_templates.php:22) in /*/htdocs/forums/inc/adminfunctions_templates.php on line 74 

I have done some reading before posting here and best I can tell is that this means a function or statement of some kind is included twice. What is it that I am looking for and how do I go about correcting it?

The second message that I have noticed sometimes, in this case when attempting to install and activate the PM on Registration hack is this:

 Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /*/forums/inc/plugins/pmonreg.php on line 202 

I checked the pmonreg.php file for allow_call_time_pass and cannot find it anywhere in the file, so a little clueless on what to do with that one.

Any help would be greatly appreciated!
I am pretty sure that allow_call_time_pass has to be added to the php.ini. Also, try re uploading inc/adminfunctions_templates.php
(2009-05-03, 03:05 AM)Joshua Mayer Wrote: [ -> ]I am pretty sure that allow_call_time_pass has to be added to the php.ini. Also, try re uploading inc/adminfunctions_templates.php

Thank you, I did the easy part that I understood fully LOL, replaced the adminfunctions_templates.php file. Using the PM on registration as a test I was able to activate it and get it to display in my admincp plugins list without the redeclare error.

However I have 2 errors remaining. The first is the allow_call_time_pass_reference to true error. Forgive my ignorance here, I have not had to do much with modifying php files, what is the proper statement I need to add to the php file? I would guess its as simple as adding a line reading

 allow_call_time_pass_reference=1 

somewhere in the php file, but I hate to randomly do it without guidance given my very limited php skills.

The second error that it is now kicking me is this one:

 Warning [2] Cannot modify header information - headers already sent by (output started at /www/emenace.com/*/forums/inc/plugins/pmonreg.php:202) - Line: 51 - File: admin/index.php PHP 5.2.6 (Linux)

[PHP] 	  	errorHandler->error
/admin/index.php 	51 	header 

My first thought was that permissions for the /admin/index.php were wrong but that was not the case, so I am unsure what to do with this one either.

Again forgive my ignorance here and thanks for the help Smile
Quote:
 Warning [2] Cannot modify header information - headers already sent by (output started at /www/emenace.com/*/forums/inc/plugins/pmonreg.php:202) - Line: 51 - File: admin/index.php PHP 5.2.6 (Linux)

[PHP] 	  	errorHandler->error
/admin/index.php 	51 	header 

I am guessing that you edited pmonreg.php with notepad? Re-extract the pmonreg.php from the ZIP file and upload it, overwriting the current one. Make sure you don't edit the extracted one.

allow_call_time_pass needs to be added to your php.ini and depending on your host, you may or may not have access to the php.ini but you should ask your host if you have access to it, and if you are unsure on what should be changed in the php.ini, ask your host to enable allow_call_time_pass for you.
(2009-05-03, 03:56 AM)Joshua Mayer Wrote: [ -> ]
Quote:
 Warning [2] Cannot modify header information - headers already sent by (output started at /www/emenace.com/*/forums/inc/plugins/pmonreg.php:202) - Line: 51 - File: admin/index.php PHP 5.2.6 (Linux)

[PHP] 	  	errorHandler->error
/admin/index.php 	51 	header 

I am guessing that you edited pmonreg.php with notepad? Re-extract the pmonreg.php from the ZIP file and upload it, overwriting the current one. Make sure you don't edit the extracted one.

allow_call_time_pass needs to be added to your php.ini and depending on your host, you may or may not have access to the php.ini but you should ask your host if you have access to it, and if you are unsure on what should be changed in the php.ini, ask your host to enable allow_call_time_pass for you.

I had not modified the pmonreg.php file as I was not sure how to do it properly. To ensure that it was not otherwise currupted I replaced with a freshly extracted original from the ZIP package with the same result. Sad

I put in a ticket asking the host about modifying the php.ini file as I believe I do not have access to it. Short of that I will try and think of a workaround for it, I can see one just can't figure it out yet.

As far as the error reference to the /admin/index.php any ideas there?
(2009-05-03, 02:59 AM)t134aa Wrote: [ -> ]
 Attempting to activate:
Fatal error: Cannot redeclare find_replace_templatesets() (previously declared in /*/htdocs/forums/inc/adminfunctions_templates.php:22) in /*/htdocs/forums/inc/adminfunctions_templates.php on line 74 

I have done some reading before posting here and best I can tell is that this means a function or statement of some kind is included twice. What is it that I am looking for and how do I go about correcting it?
Yes, the most likely cause is that adminfunctions_templates.php is being included twice. Search the plugin file for "require" and "include" (these are whole words) and try changing them to "require_once" and "include_once" respectively.

(2009-05-03, 02:59 AM)t134aa Wrote: [ -> ]The second message that I have noticed sometimes, in this case when attempting to install and activate the PM on Registration hack is this:

 Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /*/forums/inc/plugins/pmonreg.php on line 202 
Basically, it means the plugin is using code for older PHP versions which are no longer (really) supported in your PHP version. You can force PHP to ignore this (editing php.ini), but I suggest against it. Can you post pmonreg.php here?


(2009-05-03, 03:48 AM)t134aa Wrote: [ -> ]
 Warning [2] Cannot modify header information - headers already sent by (output started at /www/emenace.com/*/forums/inc/plugins/pmonreg.php:202) - Line: 51 - File: admin/index.php PHP 5.2.6 (Linux)

[PHP] 	  	errorHandler->error
/admin/index.php 	51 	header 
This error will probably go away when you fix the above Toungue
It would appear that I solved the problem thru a bit more research into PHP. I tested my solution on the pmonreg.php file and the plugin works fine with no errors now.

from the pmonreg.php:

pmonreg_handle_error(&$pmhandler);
		}
	}
}

function pmonreg_handle_error(&$pmhandler) 

If I understand correctly the &$(function) was passing data into a function that php 5.x does not deal with like php 4 or older, this was causing the error. The solution was simply editing out the "&" so that the problem functions read as ($pmhandler). I assume as some other plugins cause the same or identical error a similar edit of the plugin php for each should resolve the issue.

Thank you much to everyone for the help! Big Grin