By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,709 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

PHP 5.03 IIS 6 Oracle 9i connection help needed

P: n/a
Hi, I set up PHP 4.xx using Apache 1.3 on Windows XP to begin a
project. The project now needs to be moved to a real test box.
Admittedly, I am not quite sure how I was able to access Oracle on my
machine, but I know I have the Oracle client installed, have two odbc
DSNs (CAI/PT Oracle 8) installed and uncommented php_oci8.dll and
php_oracle.dll. Other than that, I kind of just played around until it
worked.

Now my code needs to be moved to a W2k3 IIS 6 machine. PHP 5.0.3 was
installed. The database is on a different server and is Oracle 9i.
Some of the same steps were followed, but I am not able to connect. I
want to have the proper connection procedures. Can someone outline the
steps I need to take, or provide a link to a tutorial for a setup
similar to this one?

Thanks,
Jay

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

ja**************************@THANKSgmail.com wrote:
Can someone outline the
steps I need to take, or provide a link to a tutorial for a setup
similar to this one?


I ran it with instantclient and xampp (PHP 5.0.3) on Windows without
having to build anything.

If you don't have an oracle install yet, try putting Oracle Instant
Client, instantclient, on the PHP box and test connect using sqlplus,
make sure that works. Then some of the tips below may help.

I got OCI8 working on Windows, albeit with the prebuilt xampp stack.

http://www.oracle.com/technology/pub...p_instant.html

A patch to fix the distro for PHP 5 is given in the manual comments:
http://us2.php.net/oci8

The patch is here, I've built with this:
http://www.pubanz.de/jakob/php5_ociclient.zip

This part of the message is to post tips for Oracle OCI on Solaris:

Just made this on solaris8 32bit, actually works.

1) put everything in one directory
2) unsetenv ORACLE_HOME
3) set the env vars LD_LIBRARY_PATH and SQLPATH and TNS_ADMIN(if you
have it) to that directory.
4) use one of the other easy connection notations here

http://www.oracle.com/technology/
docs/tech/sql_plus/10102/readme_ic.htm

These env vars worked when put at the top of apachectl script as well.

To build you may have to fake it out with an ORACLE_HOME var, but
unset it later. You may also have to fake out the build by putting
header files where it is looking for them, e.g. in the rdbms/demo
directory or some such other place.

When running though, make sure you have only the files required in
only one directory.

Oracle has not put up a link to the 32bit solaris sqlplus--you have to
guess it--it's there though:

http://download.oracle.com/otn/solaris/instantclient/
instantclient-sqlplus-solaris32-10.1.0.3.zip

....and don't forget to add ".world" on to the end of your SID. It's
very common to have to specify DBNAME.WORLD to connect.

Jul 17 '05 #2

P: n/a
On 23 Feb 2005 09:22:59 -0800, "ja**************************@THANKSgmail.com"
<Ja**************@gmail.com> wrote:
Hi, I set up PHP 4.xx using Apache 1.3 on Windows XP to begin a
project. The project now needs to be moved to a real test box.
Admittedly, I am not quite sure how I was able to access Oracle on my
machine, but I know I have the Oracle client installed, have two odbc
DSNs (CAI/PT Oracle 8) installed and uncommented php_oci8.dll and
php_oracle.dll. Other than that, I kind of just played around until it
worked.

Now my code needs to be moved to a W2k3 IIS 6 machine. PHP 5.0.3 was
installed. The database is on a different server and is Oracle 9i.
Some of the same steps were followed, but I am not able to connect. I
want to have the proper connection procedures. Can someone outline the
steps I need to take, or provide a link to a tutorial for a setup
similar to this one?
Here's the main steps:

(1) Install Oracle Client (including OCI), either 9i (9.2) or 10g (10.1).

(2) Patch Oracle up to latest patchset.

(3) Ensure $ORACLE_HOME/bin is added to the PATH environment variable -
systemwide so that the webserver gets it in its environment. You'll need to
restart at least the webserver, if not the machine, to get the environment
changes picked up.

(4) Modify permissions on the Oracle home to allow the IIS6 user
(IUSER_<machinename>, I think) to read and execute, else it won't be able to
load the library - 9i and 10g by default set permissions so it won't.

(5) Make sure the database you want to connect to is properly set up in
tnsnames.ora. Optionally use the TNS_ADMIN environment variable to point to a
tnsnames.ora outside the Oracle home if you've got one somewhere else,
otherwise just modify the one in $ORACLE_HOME/network/admin.

(6) Activate php_oci8.dll in php.ini.

And you're done.

There are a load of things that can go wrong, of course. You've said:
Some of the same steps were followed, but I am not able to connect.


... but not said what problems you have. If you post that then you could get
more relevant advice.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.