PHP Fatal error: Cannot redeclare

If your browser saw an error message PHP Fatal error: Cannot redeclare function it is an issue with your code or script as it tries to declare the same function multiple times

It means the function is already defined  or the following can be the issue

  1. Same function defined in two files.
  2. Same function defined in two places within the same file.
  3. the file where the function is defined is included two times (function defined 2 times)

You can use the include_once instead of include to include your functions.php file to overcome the issue you face in the above 3rd point. 

Related Articles

Comparison between Plesk and SolidCP ControlPanel.

Please refer to the below table which is showing the comparison between Plesk and SolidCP Control...

How to add/host a website to VPS and point the domain to VPS?

Point 1: How to Add Website & Use Name Server of your VPS? (1) Host a website in the...

Receiving unexpected T_STRING error.

If you are receiving this error, this means .html files are parsed as PHP. In case, your .html...

What are the Differences Between Forward Proxy and Reverse Proxy?

Generally, there are two types of proxy servers available which are Forward Proxy and Reverse...

List of Database connection file location of various CMS.

Here is the list of  Database connection file locations of various CMS in cPanel. If you are...

  • 0 Users Found This Useful

Was this answer helpful?