I already have PHP 7.4.11 and Apache 2.4.46 installed on my Mac via Homebrew.
Then installed Oracle instant client & sqlplus (v19.3.0.0.0):
$ brew tap InstantClientTap/instantclient
$ brew install instantclient-basic
$ brew install instantclient-sqlplus
Next is to install the OCI8 extension, by running:
pecl install oci8
PECL prompted me this:
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] :
I was not sure what is this /path/to/instant/client/lib
, so I ran locate sqplus
:
/usr/local/Cellar/instantclient-sqlplus /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/.brew /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/.brew/instantclient-sqlplus.rb /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/INSTALL_RECEIPT.json /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/bin /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/bin/sqlplus /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib/libsqlplus.dylib /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib/libsqlplusic.dylib /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/libexec /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/libexec/sqlplus /usr/local/Homebrew/Library/Taps/instantclienttap/homebrew-instantclient/Formula/instantclient-sqlplus.rb /usr/local/bin/sqlplus /usr/local/lib/libsqlplus.dylib /usr/local/lib/libsqlplusic.dylib /usr/local/opt/instantclient-sqlplus /usr/local/var/homebrew/linked/instantclient-sqlplus
OK, let's try these 2 directories:
/usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib
checking Oracle ORACLE_HOME install directory... /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib checking ORACLE_HOME library validity... configure: error: Oracle library directory not found in /usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib ERROR: `/private/tmp/pear/temp/oci8/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-oci8=/usr/local/Cellar/instantclient-sqlplus/19.3.0.0.0dbru/lib' failed
/usr/local/lib/
checking Oracle Instant Client directory... /usr/local/lib/ checking Oracle Instant Client SDK header directory... configure: error: Oracle Instant Client SDK header files not found ERROR: `/private/tmp/pear/temp/oci8/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-oci8=instantclient,/usr/local/lib/' failed
/path/to/instant/client/lib produced the same error like the former.
What's the correct one, then?