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 enable CORS for your website?

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

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

How to activate SSL Certificate?

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

"which" command in Linux

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

Comparison of control panels Plesk VS WHM/cPanel.

Web Hosting control panels are very useful to manage your servers with a front-end graphical web...

  • 0 Users Found This Useful

Was this answer helpful?