Search




TOPページへ

このブログのフィードを取得
[フィードとは]

Powered by
Movable Type 4.23-ja

template by tokyobuddha

 ■■■■■免 責■■■■■
このサイトを参考にしたために発生した一切の損害に「てきとー管理者」は一切関知しませんし、補償もしません。 また、本サイトの記述が正しいことも保証しません。
自己責任にてお願いします。
 -------------------------

Galler Chocolate
ベルギー王室御用達として認定されたチョコレートブランド、ガレー。

Centos7でoci8を使う場合

OS標準のPHPだとoci8のパッケージが無いので、個別に入れなければならない。
ちと、面倒〜〜

oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm のインストール後、

# pecl install oci8-2.0.11
# vi /etc/php.d/oci8.ini
---
; Enable oci8 extension module
extension=oci8.so
---
を書き込んで、

# systemctl restart httpd

# php -m | grep oci
oci8


# php -i | grep oci8
/etc/php.d/oci8.ini,
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20


# php -i | egrep -i 'oracle|oci'
/etc/php.d/oci8.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.11
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20


# php --rf oci_connect
Function [ function oci_connect ] {

- Parameters [5] {
Parameter #0 [ $username ]
Parameter #1 [ $password ]
Parameter #2 [ $connection_string ]
Parameter #3 [ $character_set ]
Parameter #4 [ $session_mode ]
}
}


pdo_ociも使い場合は、下記も実行

# git clone https://github.com/hotta/pdo_oci
# cd pdo_oci
# phpize
# ./configure --prefix=/usr --exec-prefix=/usr --with-php-config=php-config --with-pdo-oci=instantclient,/usr,12.1
# make
# make install

# vi /etc/php.d/pdo_oci.ini
---
; Enable oci extension module
extension=pdo_oci.so
---


# systemctl restart httpd


# php -m|grep -i pdo_oci
PDO_OCI


# php -i | egrep -i 'oracle|oci'
/etc/php.d/oci8.ini,
/etc/php.d/pdo_oci.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.11
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
PDO drivers => mysql, oci, odbc, sqlite
PDO_OCI
PDO Driver for OCI 8 and later => enabled
PWD => /home/takahashi/soft/pdo_oci
ORACLE_HOME => /usr/lib/oracle/12.1/client64/lib
_SERVER["PWD"] => /home/takahashi/soft/pdo_oci
_SERVER["ORACLE_HOME"] => /usr/lib/oracle/12.1/client64/lib


# php -m | grep oci
oci8


# php -i | grep oci8
/etc/php.d/oci8.ini,
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20


# php -i | egrep -i 'oracle|oci'
/etc/php.d/oci8.ini,
/etc/php.d/pdo_oci.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.11
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
PDO drivers => mysql, oci, odbc, sqlite
PDO_OCI
PDO Driver for OCI 8 and later => enabled
PWD => /home/takahashi/soft/pdo_oci
ORACLE_HOME => /usr/lib/oracle/12.1/client64/lib
_SERVER["PWD"] => /home/takahashi/soft/pdo_oci
_SERVER["ORACLE_HOME"] => /usr/lib/oracle/12.1/client64/lib


# php --rf oci_connect
Function [ function oci_connect ] {

- Parameters [5] {
Parameter #0 [ $username ]
Parameter #1 [ $password ]
Parameter #2 [ $connection_string ]
Parameter #3 [ $character_set ]
Parameter #4 [ $session_mode ]
}
}

こんな感じでしょうか〜〜

お世話になった参考サイト
http://shobon.hatenablog.com/entry/2016/05/03/133732
http://net-newbie.com/php/pdo_oci_cent7.html

ありがとうございます。

投稿時間: 12:40