connecting to Oracle 9i from PHP using Oracle instant client

Been trying a simple oratest.php file that has code to connect to a local Oracle 9i database. However I keep getting fatal errors saying:

Unable to load dynamic library "D:\Program Files\Zend\Core for Oracle\lib\phpext\php_oci8..dll-Access is denied

Where do I get the Instant client for Oracle 9i from and what are the steps to make it work? My php by itself is working ok
perfect_tranquilityAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

perfect_tranquilityAuthor Commented:
what i did now was to uninstall everything including Zend for Oracle and PHP 5.2.5  I again installed Zend Core for Oracle v2.5 .i can run phpinfo() type files of extension php and i see the oci8 dll file too and others as well. how do i configure them now so that i can connect to an Oracle service running in background?
0
perfect_tranquilityAuthor Commented:
how come i am getting no answers?  no answer to this and none after 1 comment to the other?
0
hernst42Commented:
Connection to oracle database is done via
oci_connect('username', 'password', '//oracledbservername/oracledbname');

http://www.php.net/manual/en/ref.oci8.php
Do you see that oci8 is enable in your phpinfo?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

sdstuberCommented:
perhaps nobody knows the answer.

to get the instant client, you can download from otn.oracle.com

if you already have the oracle dll's though, it would appear you already have the client
0
hernst42Commented:
Zend Core for Oracle typical comes with all you need. Use a plain Windows install with IIS, download Zend Core, install it and you have php with oracle support and all needed libs.
0
perfect_tranquilityAuthor Commented:
first i thank you for making me feel better. Though this is not a personal forum but it feels good to have some experienced guiding me when I am stuck at this problem and have just had to undergo some heart tests because my BP was very elevated and felt angina pain.

OK, l am back to the problem.

stuber:  I have been surfing all over to get instant client reading that it is used only with Oracle 10g not 9i(the one we use at work). I will write the complete configuration in my next comment and that might help you more to help me

hernst: I did what you have written before. ZendCore shows up under the Web Sites-> Default Web Sites.  When I did a http://localhost/ZendCore  the page displayed: This page should refresh automatically. It gets redirected to login.php page.

I am prompted for a password with a ZendCore welcome page.I can login  and I can go ahead and see the menus and then I click on PHPinfo. That brings out the configuration(PHP Version 5.2.5) page (index.php).I can scroll down but there is no mention of oci8.dll library.
Physically the mentioned dll is located under Program Files\Zend\Core For Oracle\lib\phpext which I shared on Default Web Site and also extended full permissions to Launch IIS Process Account.

Also under PHP variables section, -SERVER["PATH"] besides other folders also points to D:\ora_instantclient even though there is no folder on my system.

Under Extensions menu it clearly shows oci8-Oracle as a service disabled.When I click on it,I get redirected to another page that says: You will need the Oracle client libraries to use this extension and it also mentions the variables I need to set.

I am at work but in a few hours I will also attach snapshots so that it becomes even clearer.
0
hernst42Commented:
if the oracle lib are not installed, run the ZendCore-Setup/update utility (should be in Zend/Core/setup ) and install the missing libs/additional components
0
sdstuberCommented:
>> "I have been surfing all over to get instant client reading that it is used only with Oracle 10g not 9"

correct, 10g introduced the instant client.  Prior to that you have to install the full client.
You can get that from otn as well.

You can only get patches and updates to the client from metalink though.
0
perfect_tranquilityAuthor Commented:
I am listening carefully to both of you. :-)

hernst: Trying to do as you advised. It is now trying to look for the location of OIC package as I answered yes if there is client on the machine.There is a folder  called oic (looks like Oracle Instant Client). It has just 4 dlls as opposed to many in the phpext folder.

the 4 dlls are: oci.dll, ociw32.dll,oraociei10.dll,orannzsbb10.dll  

however the oci8.dll file is in phpext folder. should I copy it into the former folder?
0
perfect_tranquilityAuthor Commented:
I copied the oci8.dll and then tried to make use of each one of those dlls as OIC(desperate measure). Each time, message=The file does not exist or has a wrong size. It looks like a version mismatch right now.

Later, I tried the Update utility again. This time I answered NO if I have OIC installed. It tried to download Oracle Instant Client, however as my personal laptop is not connected to Internet at work, nothing could be downloaded.

I will go back home soon and try these steps connected.But I thought this was imp that I let you know this.
Thanks !!!!
0
perfect_tranquilityAuthor Commented:
just before I leave for home, one question:  It also appears oci8.dll is probably the only file that acts as the "client". is it true? or is it a php extension ONLY?
0
sdstuberCommented:
there is definitely more to the client than just that dll.  That dll contains the oci (oracle call interface) libraries.  that let's you execute statements but doesn't allow you to connect to the database.
0
perfect_tranquilityAuthor Commented:
allright...now just at the brink of going home...I just tried to see who is exactly the user behind http://localhost.   I heard the user is the Internet User: IUSR_MachineName , however:

1). I just shared the Zend folder and gave all the permissions to the Internet User and took all away from Administrator(the account I used to log into Win2003) ,I could not do http://localhost/Zend (Error 403)

2).when i did the reverse of above, I could do http://localhost/Zend and could see the directory structure underneath(just as i was trying to)

Does that show that on my machine, IIS is actually using the user thatis logged in to 2003 rather than any Internet user?

Answer to this should clear quite a bit of fog!
Thanks
0
perfect_tranquilityAuthor Commented:
sorry , the error mentioned is not 403 ..It  prompts me for a username and password with the caption:Connect to MachineName
0
sdstuberCommented:
sorry that appears to be Zend or PHP or IIS or browser problem  not anything with the Oracle client itself.
0
perfect_tranquilityAuthor Commented:
ok, i am here at the machine with Internet.Let me see how it behaves if I do a client install even though I believe that it should be already there with Zend

Thanks
0
perfect_tranquilityAuthor Commented:
did the above and now I see oci8 !!!


Thanks hernst, ststuber !!!!
0
perfect_tranquilityAuthor Commented:
thanks again both:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.