REGEX errors (maybe) on some servers


I’ve just done a little integration project so that we can send SMS via our website. In this I do a little REGEX to check the phone number is in a valid format. I kept getting the script intermittently halt at this stage on our live servers but it works fine on dev. Clearly we should mirror the live setup on dev so that we don’t get any surprises but it’s worse than that: we have two web servers which share the load and they’re both configured with different PHP versions, amongst other things.

Eventually we’d deduced that what we thought was an intermittent fault was actually a fault on one of the servers. We can’t work out what the difference is that’s causing this though and even with error reporting set to E_ALL we’re not getting any error messages (which we receive by email BTW, not on screen).

I’m REALLY hoping that someone here will have come across something similar and might be able to point us in the right direction in order to resolve this. The system is usable in the mean time, but it’s not great because we often have to refresh the page in order to get the interface to display.

Thanks guys, and I have my fingers crossed

Just had a look through the PHPInfo() on both servers and this is jumping out at me:

Server 1:

PCRE (Perl Compatible Regular Expressions) Support     enabled
PCRE Library Version 2008-07-04

Server 2:

PCRE (Perl Compatible Regular Expressions) Support     enabled
PCRE Library Version     7.6 2008-01-28

Directive               Local Value    Master Value
pcre.backtrack_limit    100000         100000
pcre.recursion_limit    100000         100000

This is going to be the problem, right?

My theory appears to be incorrect. All of my REGEX are in class constants and called via an autoloader. The REGEX are all in double quotes, so I thought I’d try them in single quotes see if that fixed it… seems to have done at this point.