Which "standard TNS error"? Most likely you mean TNS-12154, but there are a number of other common ones.
If you are running PHP as a CGI, then most of the Apache-related information should apply. In other words, make sure that your ORACLE_HOME, ORACLE_SID and/or TWO_TASK have been set correctly for the userID which the CGI is run as.
If you need futher help, let me know. If you really cannot figure it out, I can help you troubleshoot the problem further over the phone or via e-mail.
-- Michael
Darkstreak Consulting
www.darkstreak.com