Max Belushkin wrote:
Try using require_once or include_once
Well, here's all the fun starting. This is relatively long, but please bear
with me.
First of all, yes, I did include_once, require_once, even resorted to "if (!
$inc_done) include_once("func.php")", and setting $inc_done in func.php.
No-go, was still getting the "Cannot redefine mquery()" error message.
Now for the fun.
I've had a different set of scripts employing a different "func.php". Let's
say, for simplicity, /home/test1/index.php included /home/test1/func.php,
and /home/test2/index.php included /home/test2/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?
If so thats your problem, you cannot re-define functions
paths where set as written above. And, what do you know? If I worked inside
test1 for a while, and went to test2, I'd get:
Cannot redefine mquery() in /home/test2/func.php line 9 (first defined
in /home/test1/func.php on line 9). Voila.
Going through PHP 4.4.1 release notes, I noticed the change stating "fixed a
memory corruption bug in include()". Now, I don't know how FreeBSD ported the
PHP code into it's ports tree, but for me, on FreeBSD 5.1, PHP 4.4.1
*introduced* a memory corruption bug in include.
I downgraded to 4.4.0, and everything works perfectly fine again.
I've written to the freebsd-questions mailing list, but got no sensible
reply so far (only one was "upgrade the ports that use PHP to newer versions,
but my own simple set of scripts exhibits this very strange behaviour, so
it's not a solution).
I'll wait a few days to see if anyone else in FreeBSD experiences the same
behaviour (the port was only introduced 2-3 days ago) before posting a bug
report, else if no one else sees the same thing I did, I'll have to dig
through PHP code to see what was modified in the include()-related code, I
guess, and see what influences the behaviour I'm seeing...
Comments?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php