cara install pdo_oci di centos 7 dan php7
1. selinux di disable terlebih dahulu
2. refernsi
https://www.oracle.com/technetwork/articles/dsl/php-oic-install-linux-2275399.html
https://github.com/NatLibFi/NDL-VuFind2/wiki/Oracle-with-PHP-5.6-or-PHP-7-on-RHEL-6-or-CentOS-7
3. install php dari https://webtatic.com/packages/php70/
php lewat webtatic
php70w.x86_64 7.0.33-1.w7 @webtatic
php70w-bcmath.x86_64 7.0.33-1.w7 @webtatic
php70w-cli.x86_64 7.0.33-1.w7 @webtatic
php70w-common.x86_64 7.0.33-1.w7 @webtatic
php70w-dba.x86_64 7.0.33-1.w7 @webtatic
php70w-devel.x86_64 7.0.33-1.w7 @webtatic
php70w-embedded.x86_64 7.0.33-1.w7 @webtatic
php70w-enchant.x86_64 7.0.33-1.w7 @webtatic
php70w-fpm.x86_64 7.0.33-1.w7 @webtatic
php70w-gd.x86_64 7.0.33-1.w7 @webtatic
php70w-imap.x86_64 7.0.33-1.w7 @webtatic
php70w-interbase.x86_64 7.0.33-1.w7 @webtatic
php70w-intl.x86_64 7.0.33-1.w7 @webtatic
php70w-ldap.x86_64 7.0.33-1.w7 @webtatic
php70w-mbstring.x86_64 7.0.33-1.w7 @webtatic
php70w-mcrypt.x86_64 7.0.33-1.w7 @webtatic
php70w-mysql.x86_64 7.0.33-1.w7 @webtatic
php70w-odbc.x86_64 7.0.33-1.w7 @webtatic
php70w-opcache.x86_64 7.0.33-1.w7 @webtatic
php70w-pdo.x86_64 7.0.33-1.w7 @webtatic
php70w-pdo_dblib.x86_64 7.0.33-1.w7 @webtatic
php70w-pear.noarch 1:1.10.4-1.w7 @webtatic
php70w-pecl-apcu.x86_64 5.1.9-1.w7 @webtatic
php70w-pecl-igbinary.x86_64 2.0.5-1.w7 @webtatic
php70w-pecl-imagick.x86_64 3.4.3-1.w7 @webtatic
php70w-pecl-memcached.x86_64 3.0.4-1.w7 @webtatic
php70w-pecl-mongodb.x86_64 1.5.3-1.w7 @webtatic
php70w-pecl-redis.x86_64 3.1.6-1.w7 @webtatic
php70w-pecl-xdebug.x86_64 2.6.1-1.w7 @webtatic
php70w-pgsql.x86_64 7.0.33-1.w7 @webtatic
php70w-phpdbg.x86_64 7.0.33-1.w7 @webtatic
php70w-process.x86_64 7.0.33-1.w7 @webtatic
php70w-pspell.x86_64 7.0.33-1.w7 @webtatic
php70w-recode.x86_64 7.0.33-1.w7 @webtatic
php70w-snmp.x86_64 7.0.33-1.w7 @webtatic
php70w-soap.x86_64 7.0.33-1.w7 @webtatic
php70w-tidy.x86_64 7.0.33-1.w7 @webtatic
php70w-xml.x86_64 7.0.33-1.w7 @webtatic
php70w-xmlrpc.x86_64 7.0.33-1.w7 @webtatic
4. download targz dari
https://secure.php.net/get/php-7.1.26.tar.gz/from/a/mirror ( misalnya sesuaikan dengan versi )
5. cd php-7.y.z
cd ext
cd pdo_oci
phpize
./configure --with-pdo-oci=instantclient,/usr,12.1
make
make install
echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini
php -i |grep oci
6.
https://kenyataanini.wordpress.com/2015/06/18/installing-pdo_oci-and-oci8-php-di-centos-6-5/
$ pear download pecl/oci8
$ tar -xvf oci8-1.4.9.tgz
$ cd oci8-1.4.9
Installasi extension.
$ phpize
$ ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib
$ make
$ sudo make install
Untuk mengaktifkan ekstensi, menambahkan file bernama oci8.ini di /etc/php.d dengan menuliskan baris ini:
extension = oci8.so
Kemudian memvalidasi bahwa itu berhasil diinstal.
# Php-i | grep oci8
Jika kalian sudah keluar Output Seprti ini maka berhasil :
/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
5. tes koneksi oci
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$conn = oci_connect('fault', 'fault', '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.14.23.98)(PORT=1521)) (CONNECT_DATA=(SERVER=DEDICATED) (SID=FMS1)))');
if($conn){
echo "konek";
}else{
echo "gagal";
}
?>
1. selinux di disable terlebih dahulu
2. refernsi
https://www.oracle.com/technetwork/articles/dsl/php-oic-install-linux-2275399.html
https://github.com/NatLibFi/NDL-VuFind2/wiki/Oracle-with-PHP-5.6-or-PHP-7-on-RHEL-6-or-CentOS-7
3. install php dari https://webtatic.com/packages/php70/
php lewat webtatic
php70w.x86_64 7.0.33-1.w7 @webtatic
php70w-bcmath.x86_64 7.0.33-1.w7 @webtatic
php70w-cli.x86_64 7.0.33-1.w7 @webtatic
php70w-common.x86_64 7.0.33-1.w7 @webtatic
php70w-dba.x86_64 7.0.33-1.w7 @webtatic
php70w-devel.x86_64 7.0.33-1.w7 @webtatic
php70w-embedded.x86_64 7.0.33-1.w7 @webtatic
php70w-enchant.x86_64 7.0.33-1.w7 @webtatic
php70w-fpm.x86_64 7.0.33-1.w7 @webtatic
php70w-gd.x86_64 7.0.33-1.w7 @webtatic
php70w-imap.x86_64 7.0.33-1.w7 @webtatic
php70w-interbase.x86_64 7.0.33-1.w7 @webtatic
php70w-intl.x86_64 7.0.33-1.w7 @webtatic
php70w-ldap.x86_64 7.0.33-1.w7 @webtatic
php70w-mbstring.x86_64 7.0.33-1.w7 @webtatic
php70w-mcrypt.x86_64 7.0.33-1.w7 @webtatic
php70w-mysql.x86_64 7.0.33-1.w7 @webtatic
php70w-odbc.x86_64 7.0.33-1.w7 @webtatic
php70w-opcache.x86_64 7.0.33-1.w7 @webtatic
php70w-pdo.x86_64 7.0.33-1.w7 @webtatic
php70w-pdo_dblib.x86_64 7.0.33-1.w7 @webtatic
php70w-pear.noarch 1:1.10.4-1.w7 @webtatic
php70w-pecl-apcu.x86_64 5.1.9-1.w7 @webtatic
php70w-pecl-igbinary.x86_64 2.0.5-1.w7 @webtatic
php70w-pecl-imagick.x86_64 3.4.3-1.w7 @webtatic
php70w-pecl-memcached.x86_64 3.0.4-1.w7 @webtatic
php70w-pecl-mongodb.x86_64 1.5.3-1.w7 @webtatic
php70w-pecl-redis.x86_64 3.1.6-1.w7 @webtatic
php70w-pecl-xdebug.x86_64 2.6.1-1.w7 @webtatic
php70w-pgsql.x86_64 7.0.33-1.w7 @webtatic
php70w-phpdbg.x86_64 7.0.33-1.w7 @webtatic
php70w-process.x86_64 7.0.33-1.w7 @webtatic
php70w-pspell.x86_64 7.0.33-1.w7 @webtatic
php70w-recode.x86_64 7.0.33-1.w7 @webtatic
php70w-snmp.x86_64 7.0.33-1.w7 @webtatic
php70w-soap.x86_64 7.0.33-1.w7 @webtatic
php70w-tidy.x86_64 7.0.33-1.w7 @webtatic
php70w-xml.x86_64 7.0.33-1.w7 @webtatic
php70w-xmlrpc.x86_64 7.0.33-1.w7 @webtatic
4. download targz dari
https://secure.php.net/get/php-7.1.26.tar.gz/from/a/mirror ( misalnya sesuaikan dengan versi )
5. cd php-7.y.z
cd ext
cd pdo_oci
phpize
./configure --with-pdo-oci=instantclient,/usr,12.1
make
make install
echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini
php -i |grep oci
6.
https://kenyataanini.wordpress.com/2015/06/18/installing-pdo_oci-and-oci8-php-di-centos-6-5/
$ pear download pecl/oci8
$ tar -xvf oci8-1.4.9.tgz
$ cd oci8-1.4.9
Installasi extension.
$ phpize
$ ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib
$ make
$ sudo make install
Untuk mengaktifkan ekstensi, menambahkan file bernama oci8.ini di /etc/php.d dengan menuliskan baris ini:
extension = oci8.so
Kemudian memvalidasi bahwa itu berhasil diinstal.
# Php-i | grep oci8
Jika kalian sudah keluar Output Seprti ini maka berhasil :
/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
5. tes koneksi oci
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$conn = oci_connect('fault', 'fault', '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.14.23.98)(PORT=1521)) (CONNECT_DATA=(SERVER=DEDICATED) (SID=FMS1)))');
if($conn){
echo "konek";
}else{
echo "gagal";
}
?>
No comments:
Post a Comment