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

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

How to activate SSL Certificate?

You can activate SSL Certificate to get secure connections on your website. Looking to purchase...

Does Mobile application requires hosting service?

Yes, you need a hosting service for the application backend to manage the following thing....

  • 0 Users Found This Useful

Was this answer helpful?