Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem installing PECL OCI8 -- SOLVED!

V. TaoFeb 27 2022 — edited Feb 27 2022

Hi!
I have XE 18c installed on OL7, with PHP7.4 and InstantClient 19.14.
I have a website on a vhost that needs to connect to the DB. This all worked fine the day of the initial setup.
After a system restart, my website couldn't connect to the DB anymore. Everything else could (sqldeveloper) so I suppossed this must be a OCI8 problem. I did some research and uninstalled and reinstalled everything besides the DB (because it's already set up and filled with data) and the vhost.
Now I tried to install PECL OCI again, and this is what I get:
*pecl install oci8-2.2.0
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /usr/lib64/php/modules/oci8.so (/usr/lib64/php/modules/oci8.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so.so (/usr/lib64/php/modules/oci8.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading oci8-2.2.0.tgz ...
Starting to download oci8-2.2.0.tgz (196,449 bytes)
.........................................done: 196,449 bytes
11 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : 'instantclient,/home/oracle/instantclient_19_14/bin'
building in /var/tmp/pear-build-oracle8ZXyFF/oci8-2.2.0
running: /var/tmp/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8='instantclient,/home/oracle/instantclient_19_14/bin'
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking for Oracle Database OCI8 support... yes, shared
checking PHP version... 7.4.28, ok
checking OCI8 DTrace support... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/sdt.h usability... yes
checking sys/sdt.h presence... yes
checking for sys/sdt.h... yes
checking size of long int... 8
checking checking if we're on a 64-bit platform... yes
checking Oracle Instant Client directory... /home/oracle/instantclient_19_14/bin
checking Oracle Instant Client SDK header directory... configure: error: Oracle Instant Client SDK header files not found
ERROR: `/var/tmp/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8='instantclient,/home/oracle/instantclient_19_14/bin'' failed*

Can't find a salution for this. Anyone can help, please?
THX
-----------------------------------
I reinstalled everything now in /opt/oracle/... and did some changes to the environment variables (which I don't remember) and it worked.

Comments
Post Details
Added on Feb 27 2022
1 comment
9,011 views