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

How do i setup rDNS/PTR record at Accuwebhosting?

Client can't set rDNS record at their end. You will need to submit a support ticket with the IP...

How to renew SSL?

If you have an existing SSL Certificate purchased from Acuwebhosting, you just need to update us...

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 register domain and make the payment?

If you are a registered client, you can directly refer to the following steps to order a new...

  • 0 Users Found This Useful

Was this answer helpful?