i'd rather not recompile as it is on a production server...
i have just solved the problem (based on what you wrote). i am using debian and i had the packages:
php4 - the standalone binary
php4-cgi - for apache
php4-mysql - mysql support
on adding the package "php4-cgi-mysql" it worked. which doesn't make any sense since php4-cgi was working fine and it was php4 that was having problems.
if you follow my logic it seems as tho the apache php should have been the one to fail and not the binary.
weird.