Solved

PHP Script unable to connect to Oracle DB

Posted on 2007-11-15
14
1,174 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 50 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I search for a text string in my SQL code 18 52
replicate in oracle 13 45
Convert CSV to list in oracle for IN-Clause 6 48
Sending JSON Via POST In PHP 7 30
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

752 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