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 make your ASP.Net applications secure?

Adding security to Web apps may not be great fun but it doesn't have to be hard. You can easily...

How to Serve Scaled Images on Your WordPress Website using plugins?

If you have tested your website in a performance testing tool and asking you to serve the scaled...

What is the difference between unmetered and unlimited bandwidth?

What is Bandwidth? In web hosting, bandwidth means the data transfer of your website to users in...

"which" command in Linux

which is a powerful command used in SSH environment to find out path of perl script, php...

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...

  • 0 Users Found This Useful

Was this answer helpful?