Hi,
Found the problem!
You should be using RedHat RPMS as we were, and we still are, but I had to pull out the source RPM and fiddle a little so I could find the problem.
The problem resides in a patch, php-4.0.4pl1-quotes.patch to be more specific. RedHat's source RPM is compiled after this patch is applied to PHP's source tree, then, resulting in this faulty operation.
A simple and fast solution, change the spec file so this patch isn't applied. I'm still trying to figure out where the problem is, debugging the source code after the patch.
Hope this could help.