Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Many pages say one can install the Oracle Instant Client. This doesn't come with a tnsnames.ora file, and I couldn't find examples of connecting without a tnsnames.ora file. You may wish to take this path, but this HOWTO assumes you've installed the normal Oracle client.

4.  Set ORACLE_HOME .

The symptom for an incorrect or missing ORACLE_HOME is an error that it couldn't locate the network service for this SID. 

In Control Panel > System > Advanced , click the Environment Variables button.  Create a new system variable called ORACLE_HOME and set it to the directory the Oracle client was installed in.  This is most likely c:\Program Files\ora92 .

...

In some environments, everything will work at this point. We did not find it to be the case with this WAMP stack and our Windows XP installations. Run test_connection.php . You may run it from a web browser, if the test script is in webroot, but error messages are written to apache's error.log  .  Running from the command line gives more informative errors.

At this point in our trek, we got error messages that the dll could not be loaded, and popups that certain DLLs were missing.

6. Add missing DLLs.

Using a dll dependency checker, like depends.exe , inspect php_oci8.dll  . Depends told us we were missing MSVCRT71.DLL  and MSJAVA.DLL .  Download missing DLLs from a trusted site and follow installation instructions . ( Our instructions said to add them to C:\WINDOWS\SYSTEM32 .

7. Delete useless NLS_LANG registry key.

If you run the test script now, you'll get an error message about "Missing or unknown NLS entry".  Per a bug report on the Oracle site,  run regedit.exe and rename or delete the registry key My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\NLS_LANG . 

8. Run the test script.

Voila! At this point, it worked.

OTHER STEPS THAT MIGHT HAVE BEEN HELPFUL:

We tried out a couple of other google-suggested solutions. They may have contributed to solving it, but there was no clear change in behavior.

* Reinstall the php_oci8.dll .

Wiki Markup
One poster suggested the extension had been improperly compiled . We downloaded the dll from \[the PECL repository\| http://pecl4win.php.net/ext.php\]  . Since this is part of PHP.net, the home of PHP, it is a trustworthy site.

* Change permissions on the dll and extension driver.

Another poster suggested that permissions were an issue, and their problem was resolved by giving full control on the extensions directory to Everybody from the file explorer.