Reputation: 15434
So my Evo site stopped working the other day - just got a 500 error. I got my host to check the logs and found this:
[error] PHP Fatal error: Cannot redeclare insert_metka() (previously declared in
/home/mysite/public_html/manager/includes/document.parser.class.inc.php(790) : eval()'d code:2)
in /home/mysite/public_html/manager/includes/document.parser.class.inc.php(790) : eval()'d code on line 12
I have tired commenting out the offending line and removing the entire file to no avail. Does anyone know what this means and how to fix it?
EDIT: the code at line 790:
eval ($pluginCode);
Upvotes: 0
Views: 1731
Reputation: 3146
Looks like a bad plugin has broken your site. Disable all your plugins and reinstate them one at a time until it breaks again, then you know which one is the culprit.
Once you've done that, post the plugin code here and we can help you debug it further. You shouldn't ever need to modify the MODX source code.
The problem is likely to be solved by wrapping the insert_metka()
declaration like this:
if(!function_exists('insert_metka')) {
function insert_metka() {
// function code
}
}
Upvotes: 1
Reputation: 27364
Accoring to document.parser.class.inc.php
this line i guess you are using OOP
.
So what you can do is create instantiation
class for above class
and then overwrite
it.
There are other things too. you might declaring
same function inside of same class
.
Upvotes: 0
Reputation: 3534
Cannot redeclare insert_metka()
says that you are declaring a function twice (may be with your evals).
You should check on your included files.
To be sure to not include more than one time, you can use include_once
or requiere_once
instead of include
and requiere
Upvotes: 0
Reputation: 46910
That appears like a very simple problem. You are declaring insert_metka()
two times. Remove it from one of the mentioned files. Once it is declared in saved file and apparently second time you are trying to declare it with the help of eval()
Upvotes: 0