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 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 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 ImunifyAV+ is useful?

ImunifyAV+ is an effective anti-malware service. It is used to scan and detect the malware lied...

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

Diagnostic Tools - Check Website Connection, Website Availability

Ping Ping is a command to check whether a destination computer system is working on a network or...

  • 0 Users Found This Useful

Was this answer helpful?