List Info

Thread: Random PHP error: Cannot Redeclare function




Random PHP error: Cannot Redeclare function
user name
2006-09-28 15:44:14
Hi everyone,

I've come across this error for the first time and I spend
about 3
hours looking for an answer. I searched the files also in
other groups
to find an answer to this issue I am having.

Function :
----------------

function getTemplateFile($template){
    $templateFile   = $_SERVER['DOCUMENT_ROOT'] .
"/inc/templates/" .
$template;
    $templateFH  = fopen( $templateFile, 'r' );
    $templateContent   = fread( $templateFH, filesize(
$templateFile)
);
    fclose($templateFH);
    return $templateContent;
}

Usage :
------------

echo getTemplateFile("testing.html");

Sometime when the page loads I get a fatal error saying the
function
getTemplateFile is already declared in the file. I cannot
find anywhere
it is been re-declared. This happens vary rarly. I do not
want to blame
Windows (if only it is clear this is a windows bug) but
would really
like get some insight into this issue.

We are using the same function on another site hosted on the
same
server. On that site we are getting the same error saying it
is being
redeclared in SiteA.com/.... Again this is intermittent.

System Spec

PHP Version 5.1.4
Win Server 2003 Web Edition with SP1

I would really appreciate your input on this matter.

Thank you in advance.

Regards

Kosala


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "PHP & MySQL" group.
To post to this group, send email to phpmysqlgooglegroups.com
To unsubscribe from this group, send email to
phpmysql-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/phpmysql
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )