Table of contents
Preamble
We have recently upgraded our internal DBA web site where we display publicly internal information and where we have few PHP pages connecting to an internal MySQL repository as well as few performance pages where we access Oracle databases. I know with recent web evolution (Vue, React, Node.js, …) it might sound a little bit weird to have PHP pages but to be honest to create what we know call Rest API I have not found anything better than PHP pages. The language is super rich and in any case to access a database backend your script must run on the server side and not on the client. Of course I could have a Node.js running on my web server but again this is so much easier to do this in PHP that I think I will continue to do it for a while…
In the past, to access MySQL, I was using the original MySQL API with procedures like mysql_connect, mysql_select_db and mysql_fetch_array. This extension has been made deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. To prepare it I have asked myself what to use between mysqli or PDO_MySQL. At that time I have decided to use PDO for the common way of working between different flavor of databases (MySQL and Oracle in my case).
When we have setup the new server I expected to configure OCI8 and PDO (PHP Data Objects) by just downloading a package on the official RedHat depot but as usual it did not go as expected and I have spent quite a few hours to sort it out…
Even if I personally like a lot the PDO approach for having a common langage regardless of the backend database Oracle is recommending to use OCI8 instead for its superior feature:
For the moment Oracle still recommends using PHP OCI8 in preference to PDO_OCI because OCI8 has superior features and can also take advantage of various Oracle client library connection and caching functionality.
I tend to say that if your are not chasing performance or top of the edge feature I would recommend PDO, particularly if like me you access multiple database flavors…
My server is a virtual machine running Red Hat Enterprise Linux Server release 7.9 (Maipo) and as the time of writing this blog post using Apache 2.4.37 and PHP Version 7.2.24. As a strong pre-requisite for all extensions (OCI or PDO_OCI) you obviously must have an Oracle client on your web server. This can be the normal, thick, client or the thin instant client. This installation has been done by a teammate and he has chosen the normal client 12.2.0.1.0 (obsolete already but whatever).
OCI8 from pecl
One option to install OCI8 modules is to go with pecl tool. To get pecl do:
[root@server ~]# dnf install php-pear |
Download oci8 for PHP 7:
[root@server tmp]# php -v PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies [root@server tmp]# wget https://pecl.php.net/get/oci8-2.2.0.tgz [root@server tmp]# pecl install oci8-2.2.0.tgz 11 source files, building running: phpize Can't find PHP headers in /usr/include/php The php-devel package is required for use of this command. ERROR: `phpize' failed |
Install php-devel:
[root@server tmp]# dnf install php-devel |
This time installation went well. Supply your Oracle home at the prompt and specify if you are using an instant client or not (display has been cut for clarity):
[root@server tmp]# pecl install oci8-2.2.0.tgz 11 source files, building running: phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 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] : /oracle/software building in /var/tmp/pear-build-rootIZwygS/oci8-2.2.0 running: /var/tmp/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8=/oracle/software checking for grep that handles long lines and -e... /usr/bin/grep . . . checking whether to build static libraries... no configure: creating ./config.status config.status: creating config.h config.status: executing libtool commands running: make . . . ---------------------------------------------------------------------- Libraries have been installed in: /var/tmp/pear-build-rootIZwygS/oci8-2.2.0/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 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' 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'. running: make INSTALL_ROOT="/var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0" install Installing shared extensions: /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0/usr/lib64/php/modules/ running: find "/var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0" | xargs ls -dils 104162 0 drwxr-xr-x 3 root root 17 Aug 4 12:30 /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0 2235876 0 drwxr-xr-x 3 root root 19 Aug 4 12:30 /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0/usr 3280107 0 drwxr-xr-x 3 root root 17 Aug 4 12:30 /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0/usr/lib64 110674 0 drwxr-xr-x 3 root root 21 Aug 4 12:30 /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0/usr/lib64/php 1144553 0 drwxr-xr-x 2 root root 21 Aug 4 12:30 /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0/usr/lib64/php/modules 1144554 876 -rwxr-xr-x 1 root root 894144 Aug 4 12:30 /var/tmp/pear-build-rootIZwygS/install-oci8-2.2.0/usr/lib64/php/modules/oci8.so Build process completed successfully Installing '/usr/lib64/php/modules/oci8.so' install ok: channel://pecl.php.net/oci8-2.2.0 configuration option "php_ini" is not set to php.ini location You should add "extension=oci8.so" to php.ini |
The oci8.so module is directly in good directory and you just need to change your PHP configuration, by adding a new file in /etc/php.d directory as below, to have it loaded:
[root@server php.d]# ll /usr/lib64/php/modules/oci8.so -rw-r--r-- 1 root root 894144 Aug 4 12:30 /usr/lib64/php/modules/oci8.so [root@server php.d]# chmod a+x /usr/lib64/php/modules/oci8.so [root@server php.d]# cat /etc/php.d/30-oci8.ini ; Enable oci8 extension module extension=oci8.so [root@server php.d]# systemctl restart httpd [root@server php.d]# systemctl restart php-fpm [root@server php.d]# php -m [PHP Modules] bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gettext hash iconv json libxml mbstring mysqli mysqlnd oci8 openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix readline Reflection session shmop SimpleXML sockets SPL sqlite3 standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl zlib [Zend Modules] [root@server php.d]# php --ri oci8 oci8 OCI8 Support => enabled OCI8 DTrace Support => disabled OCI8 Version => 2.2.0 Oracle Run-time Client Library Version => 12.2.0.1.0 Oracle Compile-time Version => 12.2 Compile-time ORACLE_HOME => /oracle/software Libraries Used => -Wl,-rpath,/oracle/software/lib -L/oracle/software/lib -lclntsh 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 |
I highly recommend to create a phpinfo() file on your web server to be able to quickly see how PHP is configured:
I have taken the example script in PHP official documentation and as it was not working I have tried directly on the server with:
[root@server html]# php oci8.php PHP Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories in /www/html/oci8.php on line 3 PHP Warning: oci_connect(): Error while trying to retrieve text for error ORA-01804 in /www/html/oci8.php on line 3 PHP Fatal error: in /www/html/oci8.php on line 6 |
This above message is really strange and I solved it with:
[ora12c@server ~]$ cd $ORACLE_HOME [ora12c@server software]$ find . -name libociicus.so ./instantclient/light/libociicus.so [ora12c@server software]$ cp ./instantclient/light/libociicus.so lib [ora12c@server software]$ ll ./lib/libociicus.so -rw-r----- 1 ora12c dba 6352804 Aug 4 15:06 ./lib/libociicus.so |
Then issuing again the script interactively worked but not via Apache with, so, an http request !!
As suggested I have tried to avoid cleaning of environment variables when forking php-fpm processes with (/etc/php-fpm.d/www.conf file):
[root@server php-fpm.d]# vi www.conf [root@server php-fpm.d]# grep clear www.conf ; by clearing the environment in workers before env vars specified in this clear_env = no [root@server php-fpm.d]# systemctl restart php-fpm [root@server php-fpm.d]# systemctl restart httpd |
But it did not solve the problem as explained in few blog posts…. So I have finally changed www.conf again and added:
env[ORACLE_HOME] = /oracle/software env[LD_LIBRAY_PATH] = /oracle/software/lib |
This time all worked well and we now have a running OCI8 module !!
PDO_OCI
When you go to official PDO_OCI page on pecl the warning message is quite clear:
PDO_OCI
This package is not maintained anymore and has been superseded. Package has moved to channel http://www.php.net/pdo_oci package ext/pdo_oci.
So in other words the package is inside the source code of PHP. Okay cool, but then if like me (and most probably 99.9% of people) your PHP is coming from the RPM of the official depot of your Linux distribution ? System admin also do not like you recompile on server as it requires tons of headers that are coming with devel packages. So ideally you should do it on a separate server but as we will see I had nothing more to install so let’s say even your preferred system administrator teammate would be happy !
I have downloaded the PHP source code of the exact same version of my running PHP 7.2.24. It also raise the question when you upgrade PHP, I will continue to try to find a more elegant solution and/or if someone can suggest in comment section I would be happy to know.
Unzip the source code and go in ext/pdo_oci directory, export the ORACLE_HOME environment variable and use phpize (https://www.php.net/manual/en/install.pecl.phpize.php). I have cut the display as it would be too long.
Run phpize and ./configure command:
[root@server php-7.2.24]# cd ext/pdo_oci/ [root@server pdo_oci]# export ORACLE_HOME=/oracle/software [root@server pdo_oci]# ll total 88 -rwxrwxr-x 1 root root 7649 Oct 22 2019 config.m4 -rwxrwxr-x 1 root root 1494 Oct 22 2019 config.w32 -rwxrwxr-x 1 root root 40 Oct 22 2019 CREDITS -rw-rw-r-- 1 root root 21968 Oct 22 2019 oci_driver.c -rw-rw-r-- 1 root root 22353 Oct 22 2019 oci_statement.c -rw-rw-r-- 1 root root 2326 Oct 22 2019 package2.xml -rw-rw-r-- 1 root root 4172 Oct 22 2019 pdo_oci.c -rw-rw-r-- 1 root root 1708 Oct 22 2019 php_pdo_oci.h -rw-rw-r-- 1 root root 3135 Oct 22 2019 php_pdo_oci_int.h drwxrwxr-x 2 root root 4096 Oct 22 2019 tests [root@server pdo_oci]# phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 [root@server pdo_oci]# ll total 1540 -rw-r--r-- 1 root root 86562 Aug 4 16:10 acinclude.m4 -rw-r--r-- 1 root root 418161 Aug 4 16:10 aclocal.m4 drwxr-xr-x 2 root root 54 Aug 4 16:10 autom4te.cache drwxr-xr-x 2 root root 115 Aug 4 16:10 build -rwxr-xr-x 1 root root 42938 Aug 4 16:10 config.guess -rw-r--r-- 1 root root 1988 Aug 4 16:10 config.h.in -rwxrwxr-x 1 root root 7649 Oct 22 2019 config.m4 -rwxr-xr-x 1 root root 35967 Aug 4 16:10 config.sub -rwxr-xr-x 1 root root 455182 Aug 4 16:10 configure -rw-r--r-- 1 root root 4684 Aug 4 16:10 configure.ac -rwxrwxr-x 1 root root 1494 Oct 22 2019 config.w32 -rwxrwxr-x 1 root root 40 Oct 22 2019 CREDITS -rw-r--r-- 1 root root 0 Aug 4 16:10 install-sh -rw-r--r-- 1 root root 324152 Aug 4 16:10 ltmain.sh -rw-r--r-- 1 root root 7156 Aug 4 16:10 Makefile.global -rw-r--r-- 1 root root 0 Aug 4 16:10 missing -rw-r--r-- 1 root root 0 Aug 4 16:10 mkinstalldirs -rw-rw-r-- 1 root root 21968 Oct 22 2019 oci_driver.c -rw-rw-r-- 1 root root 22353 Oct 22 2019 oci_statement.c -rw-rw-r-- 1 root root 2326 Oct 22 2019 package2.xml -rw-rw-r-- 1 root root 4172 Oct 22 2019 pdo_oci.c -rw-rw-r-- 1 root root 1708 Oct 22 2019 php_pdo_oci.h -rw-rw-r-- 1 root root 3135 Oct 22 2019 php_pdo_oci_int.h -rw-r--r-- 1 root root 85864 Aug 4 16:10 run-tests.php drwxrwxr-x 2 root root 4096 Oct 22 2019 tests [root@server pdo_oci]# ./configure 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 cc... cc checking whether the C compiler works... yes . . . checking whether to build shared libraries... yes checking whether to build static libraries... no configure: creating ./config.status config.status: creating config.h config.status: executing libtool commands |
Finally issue make and make test commands:
[root@server pdo_oci]# make . . . Libraries have been installed in: /tmp/php-7.2.24/ext/pdo_oci/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 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' 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'. [root@server pdo_oci]# make test . . . Number of tests : 33 0 Tests skipped : 33 (100.0%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 0 ( 0.0%) ( 0.0%) Expected fail : 0 ( 0.0%) ( 0.0%) Tests passed : 0 ( 0.0%) ( 0.0%) --------------------------------------------------------------------- Time taken : 2 seconds ===================================================================== This report can be automatically sent to the PHP QA team at http://qa.php.net/reports and http://news.php.net/php.qa.reports This gives us a better understanding of PHP's behavior. If you don't want to send the report immediately you can choose option "s" to save it. You can then email it to qa-reports@lists.php.net later. Do you want to send this report now? [Yns]: n |
Then the compiled module is in modules directory. Copy it to target directory (/usr/lib64/php/modules/) and configure php-fpm to use it:
[root@server pdo_oci]# ll modules total 204 -rw-r--r-- 1 root root 951 Aug 4 16:11 pdo_oci.la -rwxr-xr-x 1 root root 202832 Aug 4 16:11 pdo_oci.so [root@server pdo_oci]# cp modules/pdo_oci.so /usr/lib64/php/modules/ [root@server pdo_oci]# cat /etc/php.d/30-pdo_oci.ini ; Enable pdo_oci extension module extension=pdo_oci [root@server pdo_oci]# systemctl restart php-fpm [root@server pdo_oci]# php --ri pdo PDO PDO support => enabled PDO drivers => mysql, oci, sqlite |
This can also be seen in phpinfo():
OCI8 from PHP source
When installing PDO_OCI I have realized that the extension directory also contains an oci8 directory that we could also install with the same strategy and not go through pecl. What is the difference with the version in the source code versus the one on pecl repository ? I feel like the one in PHP source is closer to what’s really running on your server and the one on pecl might have some bug correction…
Let’s see if we can compile and use it. We export ORACLE_HOME, run phpize and issue ./configure command:
[root@server php-7.2.24]# cd ext/oci8 [root@server oci8]# export ORACLE_HOME=/oracle/software [root@server oci8]# ll total 444 -rw-rw-r-- 1 root root 16048 Oct 22 2019 config.m4 -rw-rw-r-- 1 root root 3845 Oct 22 2019 config.w32 -rw-rw-r-- 1 root root 173 Oct 22 2019 CREDITS -rw-rw-r-- 1 root root 3204 Oct 22 2019 LICENSE -rw-rw-r-- 1 root root 119803 Oct 22 2019 oci8.c -rw-rw-r-- 1 root root 24183 Oct 22 2019 oci8_collection.c -rw-rw-r-- 1 root root 2334 Oct 22 2019 oci8_dtrace.d -rw-rw-r-- 1 root root 5199 Oct 22 2019 oci8_failover.c -rw-rw-r-- 1 root root 70256 Oct 22 2019 oci8_interface.c -rw-rw-r-- 1 root root 27847 Oct 22 2019 oci8_lob.c -rw-rw-r-- 1 root root 60056 Oct 22 2019 oci8_statement.c -rw-rw-r-- 1 root root 48000 Oct 22 2019 package.xml -rw-rw-r-- 1 root root 2703 Oct 22 2019 php_oci8.h -rw-rw-r-- 1 root root 25333 Oct 22 2019 php_oci8_int.h -rw-rw-r-- 1 root root 976 Oct 22 2019 README drwxrwxr-x 2 root root 12288 Oct 22 2019 tests [root@server oci8]# phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 [root@server oci8]# ll total 1892 -rw-r--r-- 1 root root 86562 Aug 4 16:33 acinclude.m4 -rw-r--r-- 1 root root 418161 Aug 4 16:33 aclocal.m4 drwxr-xr-x 2 root root 54 Aug 4 16:33 autom4te.cache drwxr-xr-x 2 root root 115 Aug 4 16:33 build -rwxr-xr-x 1 root root 42938 Aug 4 16:33 config.guess -rw-r--r-- 1 root root 2244 Aug 4 16:33 config.h.in -rw-rw-r-- 1 root root 16048 Oct 22 2019 config.m4 -rwxr-xr-x 1 root root 35967 Aug 4 16:33 config.sub -rwxr-xr-x 1 root root 454262 Aug 4 16:33 configure -rw-r--r-- 1 root root 4684 Aug 4 16:33 configure.ac -rw-rw-r-- 1 root root 3845 Oct 22 2019 config.w32 -rw-rw-r-- 1 root root 173 Oct 22 2019 CREDITS -rw-r--r-- 1 root root 0 Aug 4 16:33 install-sh -rw-rw-r-- 1 root root 3204 Oct 22 2019 LICENSE -rw-r--r-- 1 root root 324152 Aug 4 16:33 ltmain.sh -rw-r--r-- 1 root root 7156 Aug 4 16:33 Makefile.global -rw-r--r-- 1 root root 0 Aug 4 16:33 missing -rw-r--r-- 1 root root 0 Aug 4 16:33 mkinstalldirs -rw-rw-r-- 1 root root 119803 Oct 22 2019 oci8.c -rw-rw-r-- 1 root root 24183 Oct 22 2019 oci8_collection.c -rw-rw-r-- 1 root root 2334 Oct 22 2019 oci8_dtrace.d -rw-rw-r-- 1 root root 5199 Oct 22 2019 oci8_failover.c -rw-rw-r-- 1 root root 70256 Oct 22 2019 oci8_interface.c -rw-rw-r-- 1 root root 27847 Oct 22 2019 oci8_lob.c -rw-rw-r-- 1 root root 60056 Oct 22 2019 oci8_statement.c -rw-rw-r-- 1 root root 48000 Oct 22 2019 package.xml -rw-rw-r-- 1 root root 2703 Oct 22 2019 php_oci8.h -rw-rw-r-- 1 root root 25333 Oct 22 2019 php_oci8_int.h -rw-rw-r-- 1 root root 976 Oct 22 2019 README -rw-r--r-- 1 root root 85864 Aug 4 16:33 run-tests.php drwxrwxr-x 2 root root 12288 Oct 22 2019 tests [root@server oci8]# ./configure checking for grep that handles long lines and -e... /usr/bin/grep . . . checking whether to build static libraries... no configure: creating ./config.status config.status: creating config.h config.status: executing libtool commands |
We run make and make test commands. My make test command is full of error but at the end I have been able to use the module:
[root@server oci8]# make . . . ---------------------------------------------------------------------- Libraries have been installed in: /tmp/php-7.2.24/ext/oci8/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 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' 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'. [root@server oci8]# make test Build complete. Don't forget to run 'make test'. ===================================================================== PHP : /usr/bin/php PHP_SAPI : cli PHP_VERSION : 7.2.24 ZEND_VERSION: 3.2.0 PHP_OS : Linux - Linux server 4.18.0-305.3.1.el8_4.x86_64 #1 SMP Mon May 17 10:08:25 EDT 2021 x86_64 INI actual : /tmp/php-7.2.24/ext/oci8/tmp-php.ini More .INIs : CWD : /tmp/php-7.2.24/ext/oci8 Extra dirs : VALGRIND : Not used ===================================================================== TIME START 2021-08-04 14:34:19 ===================================================================== FAIL oci_bind_array_by_name() and invalid values 1 [tests/array_bind_001.phpt] FAIL oci_bind_array_by_name() and invalid values 2 [tests/array_bind_002.phpt] FAIL oci_bind_array_by_name() and invalid values 3 [tests/array_bind_003.phpt] FAIL oci_bind_array_by_name() and invalid values 4 [tests/array_bind_004.phpt] FAIL oci_bind_array_by_name() and invalid values 5 [tests/array_bind_005.phpt] FAIL oci_bind_array_by_name(), SQLT_CHR and default max_length [tests/array_bind_006.phpt] FAIL oci_bind_array_by_name() and invalid values 7 [tests/array_bind_007.phpt] . . . --------------------------------------------------------------------- Number of tests : 363 358 Tests skipped : 5 ( 1.4%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 346 ( 95.3%) ( 96.6%) Expected fail : 0 ( 0.0%) ( 0.0%) Tests passed : 12 ( 3.3%) ( 3.4%) --------------------------------------------------------------------- Time taken : 55 seconds ===================================================================== ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- oci_bind_array_by_name() and invalid values 1 [tests/array_bind_001.phpt] oci_bind_array_by_name() and invalid values 2 [tests/array_bind_002.phpt] oci_bind_array_by_name() and invalid values 3 [tests/array_bind_003.phpt] . . . Basic XMLType test #2 [tests/xmltype_02.phpt] ===================================================================== You may have found a problem in PHP. This report can be automatically sent to the PHP QA team at http://qa.php.net/reports and http://news.php.net/php.qa.reports This gives us a better understanding of PHP's behavior. If you don't want to send the report immediately you can choose option "s" to save it. You can then email it to qa-reports@lists.php.net later. Do you want to send this report now? [Yns]: n make: *** [Makefile:136: test] Error 1 |
Same as for PDO_OCI the compiled module is in modules directory:
[root@server oci8]# ll modules total 880 -rw-r--r-- 1 root root 930 Aug 4 16:34 oci8.la -rwxr-xr-x 1 root root 894256 Aug 4 16:34 oci8.so [root@server oci8]# ll /usr/lib64/php/modules/oci8.so -rwxr-xr-x 1 root root 894144 Aug 4 12:30 /usr/lib64/php/modules/oci8.so |
I have installed it in /usr/lib64/php/modules and it also works well. As said you are sure it is the same version as your running PHP version, 7.2.24 in my case.
References
- Updated PHP 7.2 PDO_OCI install ‘configure’ syntax
- Installation of Oracle extensions for PHP
- PHP and OCI8 Installation for RHEL8
- Pdo_oci in PHP 7
- Linux centos centos7 install oci8 and pdo_oci extension
- PHP 7 OCI8 2.1.0 available on PECL