Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP Script unable to connect to Oracle DB

Posted on 2007-11-15
14
Medium Priority
?
1,187 Views
Last Modified: 2013-12-13
I am using wamp in Winodws XP Pro and my oracle version is 9i
I use the following method to connect with oracle.

$conn=ociplogon($user,$pwd,$sid);

But I keep getting the following error:

Fatal error: Call to undefined function ociplogon() in C:\wamp\www\test\include\dbconnection.php on line 6

Here is line 6;

$conn=ociplogon($user,$pwd,$sid);

I've already uncomment the
extension=php_oci8.dll
extension=php_oracle.dll

in php.ini file in wamp
0
Comment
Question by:bprof2007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
14 Comments
 
LVL 21

Expert Comment

by:nizsmo
ID: 20291771
do:

<?php phpinfo(); ?>

and check to see if you can see the oci extension enabled?

also check that your extension directory is in fact correct, and the dlls are present in your extension directory.
0
 
LVL 1

Author Comment

by:bprof2007
ID: 20291878
thank you for the prompt response.

i did
<?php phpinfo(); ?>

it did not show any of oci extensions enable (or disable)

but oracle support is enabled.

The extension directory is correct and it contain both files.
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20291893
then something is not right, have you restarted your apache after enabling the extensions? because if PHPINFO does not show the extension is enabled, it will not work.

Hope this helps.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:bprof2007
ID: 20292460
I have restarted apache, i have even restarted the machine, but still have the same problem!!
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20292506
from the <?php phpinfo(); ?> result, also make sure that you are using a modifying the same php.ini file which the phpinfo specifies that it is using?
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20292514
eg mine is:
C:\wamp\Apache2\bin\php.ini
0
 
LVL 48

Expert Comment

by:hernst42
ID: 20292799
the oci is not working, because you don't have the right oracle-libs. From http://www.php.net/oci8:

You will need the Oracle client libraries to use this extension. Windows users will need libraries with version at least 10 to use the php_oci8.dll.

So if you have a 9i installation you need a 10i client installation so php will be able to lod the php_oci8.dll as its build against oracle 10 client libs.
0
 
LVL 1

Author Comment

by:bprof2007
ID: 20293178
phpinfo(); shows this line

Loaded Configuration File       C:\wamp\Apache2\bin\php.ini

---
I couldn't find oracle 10i client to download, I only found 10g does this work too?



0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20293211
does your environment path contain your php extension directory too? it needs to be correct and needs to be there.
0
 
LVL 48

Expert Comment

by:hernst42
ID: 20293215
Yes ist 10g (took the i from your 9i :-)
0
 
LVL 1

Author Comment

by:bprof2007
ID: 20293495
I noticed that I didn't have C:\wamp\php\ext in the path so I did it but still have the same problem (didn't restart the machine though)

I'm downloading 10g client right now, I will install it after it finish downloading and give it a test.
0
 
LVL 21

Assisted Solution

by:nizsmo
nizsmo earned 200 total points
ID: 20294940
should restart to see if it has changed anything, but all i know is it should be in your system path for the extension to work properly.
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 800 total points
ID: 20296752
Other option is to use Zend Core for oracle which install apache, php, oracle client woth all needed libs. Additional advantage of that is, that it will not to or easyly screw up your current oracle 9 installation. See http://www.zend.com/products/zend_core
0
 
LVL 1

Author Comment

by:bprof2007
ID: 20375980
Thank you guys for your help.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question