system:
Linux web 2.6.27.21-0.1-pae #1 SMP 2009-03-31 14:50:44 +0200 i686 i686 i386 GNU/Linux
PHP Version 5.3.8
Apache Version Apache/2.2.21 (Linux/SUSE)
In my situation, the OracleDB server I was trying to connect to was a remote one, not a local one, so the above 127.0.0.1 localhost
trick didn't work.
Previously, I had temporarily fixed a DNS problem by adding an entry for my Oracle DB server into my hosts file. This IP in my hosts file was still correct - it still pointed to the correct OracleDB server IP.
By removing the entry from my hosts file, the problem went away.
I have no idea why this is a problem for OracleDB, or why the error message is so obtuse, but I hope this helps someone else.
(This was using InstantClient v12.1.0.2 on MacOS v10.11.5)
This is a error with compatibility of the runtime oracle 11g and PHP Oci support. As the OP confirm, the downgrade of the client to 10g works. The solution was found here.
Adding this to /etc/hosts resolved the issue.
127.0.0.1 someHostName
To find your computer's host name, just type hostname in Terminal. Use a text editor such as vim to edit hosts.
~ hostname
someHostName
~ cd /etc
/etc sudo vim hosts
You actually do not need to go with 127.0.0.1
in /etc/hosts
with something like
echo -e "127.0.0.1\t$HOSTNAME" >> /etc/hosts
which is against common sense (and formally against RFC 6761 only from February 2013
Kind of an old question, but I just stumbled on it after upgrading my Mac to Sierra. Until then I hadn't had the problem.
The trick is definitely to add your hostname to /etc/hosts, but you have to have the right hostname. That's easy on linux, it's in /etc/sysconfig/network. On Mac find it in System Preferences > Sharing. Under where it says Computer name will be something like computer-name.local. In /etc/hosts put
127.0.0.1 computer-name.local
Replacing computer-name with your computer name of course :). It needs this regardless of whether the database is a remote one or a local one.
I had plenty of other aliases for 127.0.0.1 but not that one. As soon as I added that one my apps started working again.
I had exactly the same problem. I fixed my /etc/hosts and /etc/sysconfig/network file and RESTARTED THE NETWORK and it works fine now. Here are some quick and dirty instructions:
http://ahmadzainuddinzakaria.blogspot.com/2012/06/warning-ociconnect-functionoci-connect.html