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

Why my order is showing as a fraud?

We at Accuwebhosting have an automated order verification system that verifies your order...

How to check Ping Report from Windows 7, 8 and 10?

You can use our Ping testing tool to test Ping alert from your local system to our Denver...

How to modify a hosts file in Windows 7, Windows 8/10, Mac OS and Ubuntu?

By Editing Host File, you can point IP Address for a Domain in your local system.   Windows 7 :...

How Can I Test My Website Before Switching DNS?

It is always important to test your website on a new web host before you change the Nameservers...

How to enable "I'm Under Attack" mode in CloudFlare Panel?

Cloudflare provides additional protection called "I m under attack" for a website which is under...

  • 0 Users Found This Useful

Was this answer helpful?