logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: how can i use oci in apache+php
Author
yangshaoxing



Joined: 08 Jul 2010
Posts: 24

PostPosted: Tue 18 Mar '25 2:32    Post subject: how can i use oci in apache+php Reply with quote

Apache/2.4.62 (Win64) PHP/8.4.5,my os is windows 10,
in php.ini,i had set
Code:
 
extension=pdo_oci
extension=oci8_19

when i run phpinfo(),
it show
PDO
PDO support enabled
PDO drivers no value
Additional Modules
Module Name
(nothing)
my oci program:
Code:

<?
 $a="MY@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LOCALHOST)(PORT=1521))(CONNECT_DATA=(SID=MYDB)))";
 
 $c=oci_connect("MY","MY",$a);

 oci_close($c);
?>

Fatal error: Uncaught Error: Call to undefined function oci_connect() in D:\page\oci.php:5 Stack trace: #0 {main} thrown in D:\page\oci.php on line 5


my pdo program:
Code:

<?
 $a="MY@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=LOCALHOST)(PORT=1521))(CONNECT_DATA=(SID=MYDB)))";

 try
 {
  $c=new PDO("oci:dbname=".$a,"MY","MY");
  $c=null;
 }
 catch(e)
 {
  print "error:".($e-getMessage())."<br>";
  die();
 }
?>

it said
Fatal error: Uncaught PDOException: could not find driver in D:\page\pdo.php:7 Stack trace: #0 D:\page\pdo.php(7): PDO->__construct('oci:dbname=MY...', 'MY', Object(SensitiveParameterValue)) #1 {main} thrown in D:\page\pdo.php on line 7

how can use oci or pdo_oci in Apache/2.4.62 PHP/8.4.5

Mod note: added code tags
Back to top
Otomatic



Joined: 01 Sep 2011
Posts: 246
Location: Paris, France, EU

PostPosted: Tue 18 Mar '25 9:38    Post subject: Reply with quote

Hi,

See https://www.php.net/manual/en/oci8.setup.php
Back to top


Reply to topic   Topic: how can i use oci in apache+php View previous topic :: View next topic
Post new topic   Forum Index -> Other Software