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 check your VPS Disk Drive is SSD or HDD?

We use HyperV virtualization technology for our Denver based Classic and SSD Windows VPS. We have...

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

Why is my Autossl failing in cPanel?

ERROR Local DNS DCV error (mail.example.com): The DNS query to...

How to choose an OS lower than Windows 2012 with 1 GB RAM?

We don't offer Windows 2008 Server OS anymore. We offer Windows Server OS 2012, 2016 and 2019....

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

  • 0 Users Found This Useful

Was this answer helpful?