Last active
August 29, 2015 14:21
-
-
Save nanasess/dc9237a4f7ffb1dd32d0 to your computer and use it in GitHub Desktop.
Windows 環境の PHP から Oracle へ接続する ref: http://qiita.com/nanasess/items/efa7c027838509a44586
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; extension=php_oci8.dll ;; Oracle 11g より前のバージョンはこちらを有効に | |
extension=php_oci8_11g.dll ;; Oracle 11g 以降のバージョンはこちらを有効に | |
extension=php_pdo_oci.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = new \Doctrine\DBAL\Configuration(); | |
//.. | |
$connectionParams = array( | |
'dbname' => '<SERVICE_NAME>', | |
'user' => 'user', | |
'password' => 'secret', | |
'host' => 'localhost', | |
'driver' => 'oci8', | |
'port' => 1521, | |
'charset' => 'AL32UTF8', | |
'db_event_subscribers' => 'Doctrine\DBAL\Event\Listeners\OracleSessionInit', | |
'service' => true | |
); | |
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment