PHP cannot redeclare function error message

PHP function FAQ: Help, I'm getting a PHP cannot redeclare function error message, how do I fix it?

Assuming you don't really have two PHP functions defined with the same name, this "cannot redeclare" function error message is usually caused by using the require or include functions to include the same common file (and therefore its functions) more than once.

PHP cannot redeclare error message - Solution

A simple fix to this problem is to change your "include" or "require" statements to "include_once" or "require_once". That is, change a statement like this:

require '';

to this:

require_once '';

and the dreaded PHP cannot redeclare function error message should go away.

(Before writing me that this doesn't work, please use a tool like the Linux grep command to search your files to make sure you haven't accidentally declared two PHP functions with the same name. That is another common cause of this PHP error message.)