With PHP 8.3, OCI is no longer compiled into the base package. Instead, you need to add it in using PECL or manually.
Here is how you do so manually.
The Steps here were performed on an Mac running Sequoia with the Oracle Instant Client installed under "/Users/oracle/product/19000/client_1". They should be mostly identical if you compile on Linux.
cc -I. -I/Users/jchung/apps/pecl-database-oci8-3.4 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -I/Users/oracle/product/19000/client_1/sdk/include -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /Users/jchung/apps/pecl-database-oci8-3.4/oci8_failover.c -MMD -MF oci8_failover.dep -MT oci8_failover.lo -fno-common -DPIC -o .libs/oci8_failover.o
/bin/sh /Users/jchung/apps/pecl-database-oci8-3.4/libtool --tag=CC --mode=link cc -shared -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -I/Users/oracle/product/19000/client_1/sdk/include -D_GNU_SOURCE -L/Users/oracle/product/19000/client_1/lib -o oci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/jchung/apps/pecl-database-oci8-3.4/modules oci8.lo oci8_lob.lo oci8_statement.lo oci8_collection.lo oci8_interface.lo oci8_failover.lo -Wl,-rpath,/Users/oracle/product/19000/client_1/lib -L/Users/oracle/product/19000/client_1/lib -lclntsh
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/oci8.so -bundle .libs/oci8.o .libs/oci8_lob.o .libs/oci8_statement.o .libs/oci8_collection.o .libs/oci8_interface.o .libs/oci8_failover.o -L/Users/oracle/product/19000/client_1/lib -lclntsh -Wl,-rpath -Wl,/Users/oracle/product/19000/client_1/lib
ld: warning: -undefined suppress is deprecated
dsymutil .libs/oci8.so || :
warning: no debug symbols in executable (-arch x86_64)
creating oci8.la
(cd .libs && rm -f oci8.la && ln -s ../oci8.la oci8.la)
/bin/sh /Users/jchung/apps/pecl-database-oci8-3.4/libtool --tag=CC --mode=install cp ./oci8.la /Users/jchung/apps/pecl-database-oci8-3.4/modules
cp ./.libs/oci8.so /Users/jchung/apps/pecl-database-oci8-3.4/modules/oci8.so
cp ./.libs/oci8.lai /Users/jchung/apps/pecl-database-oci8-3.4/modules/oci8.la
----------------------------------------------------------------------
Libraries have been installed in:
/Users/jchung/apps/pecl-database-oci8-3.4/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Johns-MacBook-Pro:pecl-database-oci8-3.4 jchung$ su
Password:
sh-3.2# make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-zts-20240924/
sh-3.2# /usr/local/apache2/bin/apachectl stop
sh-3.2# /usr/local/apache2/bin/apachectl start
