Literally out of nowhere, I am getting this message for every page on my website including the header file except the header itself.
PHP Fatal error: Cannot redeclare insert() (previously declared in /home/me/public_html/include/functions.php:19) in /home/me/public_html/include/functions.php on line 51
The header file is the only one that has a “require functions.php” and it will load if I request it by itself. Each page is made up of basically five files: scanner.php, which scans for bad bots and whether or not its a mobile device (no includes), the header file which has the functions.php include, the page file which has the content which has include scanner.php and either include header.php or mobile.header.php and the footer which has no includes.
Literally out of nowhere the pages no longer load and I get that error message. I have changed nothing about the files. Line 51 in functions.php is just a bracket, and the lines above and below are whitespace. The insert() function is only declared once and not mentioned again in the entire file.
Just to get things back and running again I remembered a similar problem so I changed the require to “require_once” and all of a sudden things are back to normal. What the hell? I don’t get it. Why the hell was it saying I am redeclaring things I am not? If you add all the files together in one page, insert is only mentioned once, so how in the hell is it being “redeclared”?
Any advice would be appreciated. Thanks.