Vittorio,
ORA-12154 error are almost ALWAYS related to your tnsnames.ora file (please see Oracle's explanation, below). I suggest that you blow-away your sqlnet.ora file if possible. Also, you should try using SID identifiers in your tnsnames.ora (i.e., not SERVICE_NAME identifiers). The other side of the equation is, of course, your listener.ora setup. If possible, test your connection to your instance from another box running sqlplus (e.g., sqlplus uname/pswd@myinstance) -- if you're able to sqlplus from a client machine, but unable to access via the web browser, then perhaps your problem lies in your PHP code. Obviously. You should also be able to connect using sqlplus, locally.
Although I'm not using that function, I'm able to run Apache/PHP on Solaris 2.7 & 8. Good luck...