Jump to content

PHP5.2.11 Oracle 9i problem


Recommended Posts

Hello to whoever reads this, well i am having a problem in running a php script that accesses oracle database, my system configuration is as follows:-

 

- Windows Xp sp2

- Oracle 9i

- Apache 2

- php 5.2.11

 

 

i had to uninstall apache 1.3 that comes with the oracle 9i, because i wanted to use the newer version of apache. Now, the problem is if i run the php script below it doesn't display data on the browser, the only output that the browser displays is the 'OCI Test' which suggests that php is correctly configured with the apache. i have also uncommented the php_oci8.dll in the php.ini file

 

 

<html>

<head><title>PHP Test with Oracle</title></head>

<body>

<pre>

<?php

 

  echo "<h1>OCI Test</h1>\n";

  $conn=OCILogon("scott", "tiger", "DB10G");

 

  $stmt = OCIParse($conn, "SELECT table_name FROM user_tables ORDER BY table_name");

  OCIExecute($stmt, OCI_DEFAULT);

  while (OCIFetch($stmt)) {

  $table_name = OCIResult($stmt, "TABLE_NAME");

  echo "$table_name<br />\n";

  }

  OCIFreeStatement($stmt);

  OCILogoff($conn);

 

?>

</pre>

</body>

</html>

 

I can't seem to understand the problem.

Link to comment
Share on other sites

Sorry guys, being a newbie i didnt know that i had to enable the "display_error" in the php.ini file ...which showed me the error, Fatal error:  Call to undefined function OCILogon() in D:\Apache\htdocs\test2.php on line 8..but now im kinda stuck as to what shud i do..Thanks in advance

Link to comment
Share on other sites

Did you restart apache after making the change to the php.ini file? If not then do it, you have to restart Apache for changes to take effect. I'm not familliar with the function, but I looked it up on php.net and it's apparently an alias of oci_connect() have you tried using that instead? I highly doubt it will make a difference, but hey, worth a shot it'll take 2 seconds.

Link to comment
Share on other sites

Thanx cags, for taking tyme in replying to my problem....i did restart apache, as a matter of fact i restart apache with every change that i make ...well i did alot of search in different forums n i found someone's post with the same problem saying that php5's php_oci.dll file doesnt work with oracle 9i ..for that id need an oracle 10g instant client installed......but my requirement is to have an oracle 9i RDBMS ...soo wat should i do now??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.