Drop the taint flag and test. Consider turning on the full cgi logging stuff so you can see the entire output of the script when erroring... Look for the ScriptLog directive. Also, is suExec involved? It can do really evil and surprising things.

extremely Many thanks, ScriptLog does not seem to work in this case but it looks very useful. With your suexec tip I think I am now on the right track.

Discovered that if I move my libs into the dir as root then it does not work. If I move them in as my own user it does.
Which is strange as apache runs as nobody, maybe the umask on root is messing with something.
root umask is 0022 my umask is 0002, not sure why but I think thats it, boy am I bad at playing the sys admin