Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 440 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
I cant install oci8 on php7

Hello all,
Last 2 days I spend to install oci8 on php7 but without success.
I still cant see oci8 in phpinfo() however I see some information in php -i.
[[email protected] ~]# php -i |grep oci8
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
;
Can you please help?
Installation was performed to centos 6.5
PHP was installed via
https://webtatic.com/packages/php70/
OCI8 was installed
http://www.oracle.com/technetwork/articles/dsl/technote-php-instant-12c-2088811.html
[[email protected] ~]# env |grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
[[email protected] ~]#
[[email protected] ~]# ls -l /usr/lib/oracle/12.1/client64/lib
total 190200
lrwxrwxrwx. 1 root root 21 Dec 19 00:06 libclntshcore.so -> libclntshcore.so.12.1
-rw-r--r--. 1 root root 6990875 Jul 7 2014 libclntshcore.so.12.1
lrwxrwxrwx. 1 root root 17 Dec 19 00:06 libclntsh.so -> libclntsh.so.12.1
-rw-r--r--. 1 root root 58793741 Jul 7 2014 libclntsh.so.12.1
-rw-r--r--. 1 root root 1768370 Jul 7 2014 libipc1.so
-rw-r--r--. 1 root root 544150 Jul 7 2014 libmql1.so
-rw-r--r--. 1 root root 6213011 Jul 7 2014 libnnz12.so
lrwxrwxrwx. 1 root root 15 Dec 19 00:06 libocci.so -> libocci.so.12.1
-rw-r--r--. 1 root root 2576030 Jul 7 2014 libocci.so.12.1
-rw-r--r--. 1 root root 109549133 Jul 7 2014 libociei.so
-rw-r--r--. 1 root root 156353 Jul 7 2014 libocijdbc12.so
-rw-r--r--. 1 root root 337137 Jul 7 2014 libons.so
-rw-r--r--. 1 root root 118491 Jul 7 2014 liboramysql12.so
-rw-r--r--. 1 root root 3670975 Jul 7 2014 ojdbc6.jar
-rw-r--r--. 1 root root 3677511 Jul 7 2014 ojdbc7.jar
-rw-r--r--. 1 root root 311555 Jul 7 2014 ottclasses.zip
-rw-r--r--. 1 root root 35925 Jul 7 2014 xstreams.jar
[[email protected] ~]# cat /etc/php.ini |grep -i oci
extension=/usr/lib64/php/modules/oci8.so
[OCI8]
; credentials (OCI_SYSOPER, OCI_SYSDBA)
; http://php.net/oci8.privileged-connect
;oci8.privileged_connect = Off
; Connection: The maximum number of persistent OCI8 connections per
; http://php.net/oci8.max-persistent
;oci8.max_persistent = -1
; http://php.net/oci8.persistent-timeout
;oci8.persistent_timeout = -1
; ping during oci_pconnect() to check the connection validity. When
; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
; http://php.net/oci8.ping-interval
;oci8.ping_interval = 60
;oci8.connection_class =
;oci8.events = Off
; http://php.net/oci8.statement-cache-size
;oci8.statement_cache_size = 20
; http://php.net/oci8.default-prefetch
;oci8.default_prefetch = 100
; Compatibility. Using On means oci_close() will not close
; oci_connect() and oci_new_connect() connections.
; http://php.net/oci8.old-oci-close-semantics
;oci8.old_oci_close_semantics = Off
[[email protected] ~]#
[email protected] ~]# cat /etc/sysconfig/httpd |grep -v '^#'
export ld_library_path=/usr/lib/oracle/12.1/client64/lib
[[email protected] ~]#
Best Answer
-
Issue resolved after 2 days
problem is SELINUX which need to be disabled.
vi /etc/selinux/config
set SELINUX=disabled
Answers
-
[[email protected] html]# php --ri oci8
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.1.0
Revision => $Id: cf5290cd9e018520198534f60dc8e9cd9c866975 $
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
Directive => Local Value => Master Value
oci8.max_persistent => -1 => -1
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
oci8.default_prefetch => 100 => 100
oci8.old_oci_close_semantics => Off => Off
oci8.connection_class => no value => no value
oci8.events => Off => Off
Statistics =>
Active Persistent Connections => 0
Active Connections => 0
[[email protected] html]#
-
[[email protected] html]# php -r "var_dump(function_exists('oci_connect'));"
bool(true)
[[email protected] html]#
and I see on browser
Fatal error: Uncaught Error: Call to undefined function oci_connect() in /var/www/html/index.php:3 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 3
-
from /var/log/httpd/error_log
[Sat Dec 19 00:51:31 2015] [notice] Digest: done
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot enable executable stack as shared object requires: Permission denied in Unknown on line 0
-
Issue resolved after 2 days
problem is SELINUX which need to be disabled.
vi /etc/selinux/config
set SELINUX=disabled
-
Is there another solution without compromising security ?