Most the time I've seen this, php and apache have been compiling against different versions of the same or similar libs. Last time, apache was hitting the netscape ldap libs, php was hitting the ones for openldap. Look for that kind of thing. Also, try compiling php with ONLY the postgresql extension, or the minimum you need to do initial testing, then adding them one at a time til it starts crashing again.
I did this with tracing the extensions, it seems to be the PGSQL. But I did not think about possibility to compile against different extensions. Will try to clean up on a larger scale.
Thanks, Iv.