From the PHP 5.3 UPGRADING file:
- The PDO_OCI php_pdo_oci8.dll library (for use with Oracle version 8 client
libraries) is no longer being built [with PHP 5.3]. Instead, use php_pdo_oci.dll (note no
'8') with Oracle 10 or 11 client libraries. Connection to other database
versions is still supported.
Oracle 関数 (PDO_OCI)
導入
警告
PDO_OCI は、OCI ライブラリを通じて PHP から Oracle
データベースへのアクセスを可能にするための
PHP Data
Objects (PDO) インターフェース を実装したドライバです。
この拡張モジュールは、 実験的 なものです。この拡張モジュールの動作・ 関数名・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 このモジュールは自己責任で使用してください。
目次
- PDO_OCI DSN — Oracle データベースに接続する
Oracle (PDO)
sixd at php dot net
27-Jun-2009 03:53
27-Jun-2009 03:53
fernando dot wendt at gmail dot com
20-Jan-2009 10:18
20-Jan-2009 10:18
To enable PDO support on PHP for Oracle Instant Client 11.1.x, you should follow the syntax above in the compile command, just as pointed by Andrew http://bugs.php.net/bug.php?id=39312, taking by default you have installed the OIC at /usr/lib/oracle (instant client and sdk at subfolder):
./configure --with-oci8=shared,instantclient,/usr/lib/oracle
--with-pdo-oci=instantclient,/usr/lib/oracle,11.1
Just saying your release version from the Oracle OIC.
It compiles fine then.
Best regards.
ken at xpressconnex dot com
06-Feb-2008 01:17
06-Feb-2008 01:17
Wow, cursade. That's a lot of typing to use the lite client.
Try this:
$db = '//hostname/servicename'; //e.g. '//192.168.1.1/orcl'
$user = 'username';
$pass = 'password';
$conn = new PDO($db,$user,$pass);
moc.aciremi@yvelj
02-Jun-2006 04:25
02-Jun-2006 04:25
A Statement of Warning:
PDO::oci does not support REF CURSORS.
This is mentioned nowhere (until now!) on this page.
And now you know!
If you want ref cursors avoid PDO for now.
My Reference for this claim:
http://www.oracle.com/technology/pub/articles/
php_experts/otn_pdo_oracle5.html
GREAT article, excellent piece, really. It's not clear to me
how old this document is, but it must have some dust on it,
given it's references to "PHP5.1 ...' which is a little way off yet' "
... as of 2006-06-01, PHP5.1 has been with us for quite some time.
cursade at hotmail dot com
21-Apr-2006 03:29
21-Apr-2006 03:29
if oracle and oracle instant client has been installed,
without db in the same host
For UNIX/LINUX,set $LD_LIBRARY_PATH
appent your instant client path and client/lib path to it,
For windows set PATH like this
After set the path ,set TNS_ADMIN everioment ,point to
where tnsnames.ora located.
Then,you can use service name to connect to your Database
Test coding
<?php
$param = $_POST;
$db_username = "youusername";
$db_password = "yourpassword";
$db = "oci:dbname=yoursid";
$conn = new PDO($db,$db_username,$db_password);
$name = $param['module'];
$file = $param['file'];
$stmt = $conn->exec("INSERT INTO AL_MODULE (AL_MODULENAME, AL_MODULEFILE) VALUES ('$name', '$file')");
?>
cursade at hotmail dot com
20-Apr-2006 06:43
20-Apr-2006 06:43
If instant client has been installed but the full oracle client
not yet ,you can use pdo to connect to oracle database
like following coding:
<?php
$tns = "
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = yourip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
";
$db_username = "youname";
$db_password = "yourpassword";
try{
$conn = new PDO("oci:dbname=".$tns,$db_username,$db_password);
}catch(PDOException $e){
echo ($e->getMessage());
}
?>
