Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: how can i use oci in apache+php |
|
Author |
|
yangshaoxing
Joined: 08 Jul 2010 Posts: 24
|
Posted: Tue 18 Mar '25 2:32 Post subject: how can i use oci in apache+php |
|
|
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
|
|
Back to top |
|
|
|
|
|
|