I ran into the same problem a few weeks ago. This kept happening in a module I wrote to wrap the OCI functions to provide a simplified, consistent database interface to the development team.
Using OCIPLogon and usleep()-ing for 30ms seemed to fix the problem. I have no idea why, but I think that it's because PHP takes a few ms to get the Oracle interface up to speed, and you need to give it some time to read the tnsnames, find the listeners in tnsnames, etc.
Or maybe not. The above has worked for us.