Ok fair enough, I see your problem now, cant say ive had this and been using 4.4.1 since the day it came out (compiled my own on debian though), maybe you should try calling that function from the second file but without actually defining the function for that file to see whether you can access the in-memory function, if it works then you have an issue with memory like you say, but why are you using two identical functions in two different files anyway, that sounds like a very bad thing to do if two scripts are called the same time with the same function name its gonna cause problems aint it?

It would also be helpful to see the mquery() script - maybe someone else may know more then!


You may also want to try compiling your own PHP and see if its PHP or the distro bundled version causing problems.



HTH




Max Belushkin wrote:
On Saturday 05 November 2005 17:49, James Benson wrote:

I've had a different set of scripts employing a different "func.php".
However, in both of those, mquery() is defined. But
they do *not* include anything else, and the


So you defined mquery() in both files and one include's or require's the
other file?


I'm sorry, but what wasn't clear in my post? A *separate* set of scripts includes a *separate* "func.php", and even not by relative, but by absolute paths! Example:
/home/test1/index.php:
<?php include ("/home/test1/func.php"); ?>
/home/test2/index.php:
<?php include ("/home/test2/func.php"); ?>

Both func.php are the same, defining a function mquery, which connects to mysql, and returns.

After working with the index.php in Test1 until I get the "Cannot redefine error", I go to test2, and I get the error that *that function was defined in /home/test1/func.php". Test1, while I'm in Test2, and that never ever ever ever (...) includes *anything* from Test1. So the *Test1* func.php is still sitting somewhere in memory in the thread test2 is being loaded on - thus, include_once does not help, as the test2 func.php is NOT included. The weird thing is, $inc_done isn't defined either for the PHP thread, as when I tried the piece of code I quoted in my last message, the include_once still went through.

How can this be happening? I do not know, but since a downgrade to 4.4.0 fixed it all back proper, I am seriously beginning to suspect a problem or undocumented (widely documented, at least) change in PHP 4.4.1 on FreeBSD ports.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to