Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.4K 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
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187.1K 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
- 443 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
OCI8 Install fail
Hello,
OS = Solaris 11.3 SRU 19
PHP = 5.6.22 (latest available on repository)
Solaris Studio = 12.4
Apache = 2.2
Attempting to follow instructions at:
I have tried 3 different oracle clients:
ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped
ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped
as well as OIC version that came with Solarisstudio12.4
All with the same end result:
ld: fatal: file /opt/solarisstudio12.4/OIC/libclntsh.so: wrong ELF class: ELFCLASS64
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `oci8.la'
ERROR: `make' failed
Any suggestions greatly appreciated.
Best Answer
-
Hey there.
I did not actually test the extension with an actual database but so far things look good.
So please let us know how it goes for you. Thanks.
Here's what I did step by step on a sparc machine running S11.3sru19.
Note that I couldn't get pecl to do this so we'll have to do it manually.
Also note that we now have native IPS packages for instantclient.
## install Oracle instantclient
# pkg list | grep instantclient
consolidation/instantclient/instantclient-incorporation 12.1.0.2.0-3 i--
database/oracle/instantclient 12.1.0.2.0-3 i--
database/oracle/instantclient/jdbc-supplement 12.1.0.2.0-3 i--
database/oracle/instantclient/odbc-supplement 12.1.0.2.0-3 i--
developer/oracle/instantclient/sdk 12.1.0.2.0-3 i--
## So if instantclient is NOT installed at a minimum
# pkg install -v database/oracle/instantclient developer/oracle/instantclient/sdk
## download oci8
$ cd /export/home/cmohrman/
$ wget https://pecl.php.net/get/oci8-2.0.12.tgz
$ tar -xpzf oci8-2.0.12.tgz
$ cd oci8-2.0.12
## for convenience I've set php 5.6 to be the default php
$ php -v
PHP 5.3.29 (cli) (built: Sep 21 2015 08:49:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.2, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH
# pkg set-mediator --no-backup-be -v -V 5.6 php
# php -v
PHP 5.6.22 (cli) (built: Mar 22 2017 09:59:29)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
$ phpize
## edit configure
## OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include
## to
## OCISDKZIPINC=/usr/oracle/instantclient/12.1/sdk/include
$ CC=gcc CFLAGS=-m64 ./configure --with-oci8=instantclient,/usr/oracle/instantclient/12.1/lib/64
$ gmake
## now become root
# gmake install
# file /usr/php/5.6/lib/extensions/no-debug-zts-20131226/oci8.so
/usr/php/5.6/lib/extensions/no-debug-zts-20131226/oci8.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
# vi /etc/php/5.6/conf.d/extensions.ini
add
extension=oci8.so
# svcadm restart apache24
# php -i | grep -i oci
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.12
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
Answers
-
Think I left out the pecl command:
pecl install oci8-2.0.12
-
Hey there.
I did not actually test the extension with an actual database but so far things look good.
So please let us know how it goes for you. Thanks.
Here's what I did step by step on a sparc machine running S11.3sru19.
Note that I couldn't get pecl to do this so we'll have to do it manually.
Also note that we now have native IPS packages for instantclient.
## install Oracle instantclient
# pkg list | grep instantclient
consolidation/instantclient/instantclient-incorporation 12.1.0.2.0-3 i--
database/oracle/instantclient 12.1.0.2.0-3 i--
database/oracle/instantclient/jdbc-supplement 12.1.0.2.0-3 i--
database/oracle/instantclient/odbc-supplement 12.1.0.2.0-3 i--
developer/oracle/instantclient/sdk 12.1.0.2.0-3 i--
## So if instantclient is NOT installed at a minimum
# pkg install -v database/oracle/instantclient developer/oracle/instantclient/sdk
## download oci8
$ cd /export/home/cmohrman/
$ wget https://pecl.php.net/get/oci8-2.0.12.tgz
$ tar -xpzf oci8-2.0.12.tgz
$ cd oci8-2.0.12
## for convenience I've set php 5.6 to be the default php
$ php -v
PHP 5.3.29 (cli) (built: Sep 21 2015 08:49:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.2, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH
# pkg set-mediator --no-backup-be -v -V 5.6 php
# php -v
PHP 5.6.22 (cli) (built: Mar 22 2017 09:59:29)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
$ phpize
## edit configure
## OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include
## to
## OCISDKZIPINC=/usr/oracle/instantclient/12.1/sdk/include
$ CC=gcc CFLAGS=-m64 ./configure --with-oci8=instantclient,/usr/oracle/instantclient/12.1/lib/64
$ gmake
## now become root
# gmake install
# file /usr/php/5.6/lib/extensions/no-debug-zts-20131226/oci8.so
/usr/php/5.6/lib/extensions/no-debug-zts-20131226/oci8.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
# vi /etc/php/5.6/conf.d/extensions.ini
add
extension=oci8.so
# svcadm restart apache24
# php -i | grep -i oci
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.12
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
-
Worked like a charm. The only additional steps I had to take follow:
# php -i | grep -i oci
PHP Warning: PHP Startup: Unable to load dynamic library '/etc/php/5.6/modules/oci8.so' - ld.so.1: php: fatal: /etc/php/5.6/modules/oci8.so: open failed: No such file or directory in Unknown on line 0
# mkdir /etc/php/5.6/modules/
# cd /etc/php/5.6/modules/
# ln -s /usr/php/5.6/lib/extensions/no-debug-zts-20131226/oci8.so
# php -i | grep -i oci
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.12
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
-
Hi,
I'm having trouble getting this process to work with php 5.3. Was there a reason to switch to php5.6? The reason is, even though php 5.6 works fine from CLI it fails from apache. I think I narrowed the problem down to there not being an apache module available for php 5.6. At least not one on oracles package repository. So I was trying to build the oci8 module using php 53 but following the above still results in a
PHP Warning: PHP Startup: Unable to load dynamic library '/var/php/5.3/modules/oci8.so' - ld.so.1: php: fatal: /app/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1: wrong ELF class: ELFCLASS64 in Unknown on line 0
Thanks