| Recommend this page to a friend! | 
| Info | Documentation | Reputation | Support forum | Blog | Links | 
| Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
| 2025-07-09 (-5 hours ago)  | Not enough user ratings | Total: 780 | All time:  4,355 This week: 29 | |||||
| Version | License | PHP version | Categories | |||
| pdo-oci 1.0.37 | GNU General Publi... | 5 | PHP 5, Databases | 
| Description | Author  | |||
This class can access Oracle databases using a PDO class wrapper. Innovation Award 
  | 
What is the best PHP oracle oci8 class?
DB class with CRUD, Function calls, Stored Procedures
| :warning: WARNING This software is abandonware. As the creator and maintainer, I don't even use PHP or Oracle _for years_, so, I can't support it anymore. It should work ok for PHP untill version 7, but seems that with 8.1 there are some alerts. Feel free to fork it and keep it going. | | --- |
Wrapping on PHP OCI functions to simulate a PDO object, using just pure PHP and the oci_* functions.
Let's face it. Installing PHP, PDO, Oracle drivers and PDO OCI is not a pleasant task. Is more pleasant to insert bamboo sticks under your fingernails than make all the voodoo needed to accomplish that task. And there are two big problems with that:
That's why I made PDOOCI.
First install the Oracle drivers (I like the instant client versions) and the
oci8 package (with pecl, this one seems to be updated often).
$ composer require taq/pdooci
{
    "require": {
        "taq/pdooci": "^1.0"
    }
}
<?php
require_once 'vendor/autoload.php';
$pdo = new PDOOCI\PDO("mydatabase", "user", "password");
Why are you not using composer? Download the src
folder from the repo and rename it to PDOOCI, then require the
PDOOCI/PDO.php file.
require_once "PDOOCI/PDO.php";
$pdo = new PDOOCI\PDO("mydatabase", "user", "password");
Yeah, the rest should work exactly the same as if you were using a PDO object. :-)
There is a test suite (using PHPUnit with a version bigger than 6.x) on the
test directory. If you want to test (you must test your code!), create a table
called people with two columns:
And some environment variables:
Don't forget to run composer install!
And then go to the test dir and run PHPUnit like:
phpunit --colors .
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Lic. | Auxiliary data | |||
| Doc. | Auxiliary data | |||
| / | src | 
| File | Role | Description | 
|---|---|---|
|    | 
Class | Class source | 
|    | 
Class | Class source | 
|    | 
Class | Class source | 
| / | test | 
| File | Role | Description | 
|---|---|---|
|    | 
Test | Unit test script | 
|    | 
Test | Unit test script | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
  | 
  | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.