Link to home
Start Free TrialLog in
Avatar of perfect_tranquility
perfect_tranquilityFlag for United States of America

asked on

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
Avatar of perfect_tranquility
perfect_tranquility
Flag of United States of America image

ASKER

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?
how come i am getting no answers?  no answer to this and none after 1 comment to the other?
ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.
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
Avatar of Sean Stuber
Sean Stuber

>> "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.
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?
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 !!!!
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?
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.
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
sorry , the error mentioned is not 403 ..It  prompts me for a username and password with the caption:Connect to MachineName
sorry that appears to be Zend or PHP or IIS or browser problem  not anything with the Oracle client itself.
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
did the above and now I see oci8 !!!


Thanks hernst, ststuber !!!!
thanks again both:-)