Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1189
  • Last Modified:

PHP Script unable to connect to Oracle DB

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
bprof2007
Asked:
bprof2007
  • 6
  • 5
  • 3
2 Solutions
 
nizsmoDeveloperCommented:
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
 
bprof2007Author Commented:
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
 
nizsmoDeveloperCommented:
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!

 
bprof2007Author Commented:
I have restarted apache, i have even restarted the machine, but still have the same problem!!
0
 
nizsmoDeveloperCommented:
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
 
nizsmoDeveloperCommented:
eg mine is:
C:\wamp\Apache2\bin\php.ini
0
 
hernst42Commented:
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
 
bprof2007Author Commented:
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
 
nizsmoDeveloperCommented:
does your environment path contain your php extension directory too? it needs to be correct and needs to be there.
0
 
hernst42Commented:
Yes ist 10g (took the i from your 9i :-)
0
 
bprof2007Author Commented:
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
 
nizsmoDeveloperCommented:
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
 
hernst42Commented:
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
 
bprof2007Author Commented:
Thank you guys for your help.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 6
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now