Solved

PHP Script unable to connect to Oracle DB

Posted on 2007-11-15
14
1,163 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
echo button 13 47
get radio button vale in array 7 37
Help cleaning out CSS 2 26
Can't connect to my database 2 13
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 is …
Via a live example, show how to take different types of Oracle backups using RMAN.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now