Fatal Error: Just Kidding!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
llfitness
Forum Newbie
Posts: 12
Joined: Mon Feb 20, 2006 3:28 pm

Fatal Error: Just Kidding!

Post by llfitness »

So my new all time favorite error is one that is both fatal AND occurs infrequently, with no apparent pattern. Here we go:
Fatal error: Cannot redeclare text_admin() (previously declared in D:\inetpub\websites\asmarterbuy\SX\tools\error_handler.php:22) in D:\inetpub\websites\asmarterbuy\SX\tools\error_handler.php on line 33
I reload and don't get this error for at least another hour.

Here's the code. The only thing before this code in this file is comments. Line 22 is the function declaration. Line 33 is the close of that function. The <==== are not in the code and were added for demonstrative purposes.
???

Code: Select all

*/

function text_admin($subject, $message) <========== line 22
	{
	// This function is bare-bones because it will probably only be used when
	// something (like the DB connection) isn't working.
	
	$to = ADMIN_TEXT_ADDRESS;
	$from = 'domains@llfitness.com';
	$headers = 'From: ' . $from . "\r\n" .
	   'X-Mailer: PHP/' . phpversion();

	mail($to, $subject, $message, $headers);
	}   <================ line 33

function error_reporter()
	{
       ........

So what's the deal?

IIS 6 / Windows 2003 / PHP 5.1.2
[/quote]
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

What is the filename of the code you posted?
User avatar
llfitness
Forum Newbie
Posts: 12
Joined: Mon Feb 20, 2006 3:28 pm

Not what I expected...

Post by llfitness »

Of all the possible issues, that hadn't even entered my brain... :)

...\asmarterbuy\SX\tools\error_handler.php
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

this type of thing seams to popup every now and then. make sure that you are including the error handler with require_once();
Post Reply