Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In the last week I've been coming across an incredibly annoying error on one of Slicehost slices. It appears that every now and then PHP will fail with a fatal error, saying a certain function is undefined. The function changes, but is always a core PHP function e.g. defined(), version_compare(), etc. This problem has occurred while using several different PHP applications - PHPMyAdmin, my own custom built apps, etc, leading me to believe that the problem is not specific to the running code.

Here are some details: - Debian Lenny - Apache 2.2.9 - PHP 5.2.6-1+lenny4 with Suhosin-Patch (running eAccelerator 0.9.6)

Apache and PHP are installed from Debian packages. Error logs show nothing out of the ordinary.

I thought memory might be an issue, but free -m reports upwards of 100MB free almost all the time. Another thing I'm trying to investigate is if the problem might be related to eAccelerator, but testing this theory out is incredibly hard because the issue doesn't appear very often and I've been using eAccelerator for months on this install without any problems up until now.

Has anyone ever come across anything like this? Why would PHP report undefined core functions?

share|improve this question
    
This question might have better success on Stackoverflow.com. –  Warner Mar 26 '10 at 19:52

1 Answer 1

What happens if you temporarily disable Suhosin with the php.ini directive

suhosin.simulation = On

Does that have any effect?

Do you have multiple php.ini files? Try locate php.ini or find / -name php.ini

As an alternative, you could write a script which checks to see if the functions exist, and if not, outputs phpinfo(), which you could examine for issues. Or possibly add an error handler which emails you some more details to help you track down this issue.

I've never heard of this in the 10+ years I've been coding PHP... I'm just guessing here. I'd be interested to know what the issue is!

share|improve this answer
    
Thanks for the reply Josh. I'm going to try this stuff shortly, although the problem has disappeared for now. I've been coding PHP for about that long as well and I've never seen anything like this happen either. It's completely bizarre. The first time it happened was last week, when a typo caused an error in some code I was writing. This may have been a freak coincidence because the same error popped up in PHPMyAdmin at the same time. I fixed the typo and the problem went away, only to happen again this morning without any code changes whatsoever. Again, it's very hard to reproduce. –  user38907 Mar 26 '10 at 22:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.