I'm using apache with php on amazon linux. I've updated php from 5.3 to 5.5 and apache from 2.2 to 2.4. Now calling

echo hash('sha256','wtf');

is behaving in a strange way. It works for a while and then starts working only 50% of the time. Apache error log is filled with 'Call to undefined function hash'.

There's no more code around this, I created a separate file with only that function used and half the time I see the hash and other half is http 500.

What could be causing this? How can a module just disappear? I don't see extension=hash.so in any of the ini files but then again it works at the start. Restarting apache helps but I'd like to figure out what's going on. What might be a sane place to start searching from?

  • It turned out to be partially a code problem. Somehow using a function in one of the modules was making another function unavailable for that particular apache process. Still not sure about the cause but at least found a workaround. – clorz Jan 8 '16 at 21:59

I'd suggest trying disabling any opcode cachers like opcache, APC, etc. if you have any enabled.

Also, see if there is anything in your php.ini for zend_extension and try disabling that.

Of course some code could rely on the above functionality so disable with caution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.