Solved

PHP Script unable to connect to Oracle DB

Posted on 2007-11-15
14
1,172 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Read XML values 8 42
selector:validator cookies 4 30
making a message body variable from an oracle select statement 4 25
php error 27 31
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

830 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