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

How to set outlook rule to receive emails to inbox?

You may face an issue where your emails are moving to the recipient spam box instead of Outlook...

How to resolve question marks and mysterious symbols on my site?

If you are seeing some strange symbols that are displaying on your site, it is due to incorrect...

How to enable CORS for your website?

A request for the website resource like images or fonts from outside of the origin website is...

what is mod security? How to fix the 403 forbidden error in WordPress?

Mod Security is a web app firewall (WAF). It monitors and blocks the malicious incoming...

How to check VPS bandwidth usage from Accuwebhosting Client area?

You can easily view your VPS bandwidth report from the bandwidth meter tool. Please refer to the...

  • 0 Users Found This Useful

Was this answer helpful?