Install OCI8 and or PDO - OCI On OSX Via Brew GitHub
Install OCI8 and or PDO - OCI On OSX Via Brew GitHub
Install OCI8 and or PDO - OCI On OSX Via Brew GitHub
krisanalfa / macosx-install-php-oracle-oci8-pdo_oci.md
forked from gido/macosx-install-php-oracle-oci8.md
macosx-install-php-oracle-oci8-pdo_oci.md
Installation
This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).
Preparation
Download the following files from Oracle website (yes, you need to create an account and accept terms):
instantclient-basic-macos.x64-11.2.0.4.0.zip
instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
instantclient-sdk-macos.x64-11.2.0.4.0.zip
Create and unzip all theses files into a the directory /usr/local/instantclient/11.2.0.4/ . This directory will looks like:
.
├── BASIC_README
├── SQLPLUS_README
├── adrci
├── genezi
├── glogin.sql
├── libclntsh.dylib.11.1
├── libnnz11.dylib
├── libocci.dylib.11.1
├── libociei.dylib
├── libocijdbc11.dylib
├── libsqlplus.dylib
├── libsqlplusic.dylib
├── ojdbc5.jar
├── ojdbc6.jar
├── sdk
│ ├── SDK_README
│ ├── demo
│ ├── include
│ ├── ott
│ └── ottclasses.zip
├── sqlplus
├── uidrvci
└── xstreams.jar
Create symlinks
https://gist.github.com/krisanalfa/09b765bb95012cd36fbd Page 1 of 6
Install OCI8 and / or PDO_OCI on OSX via Brew · GitHub 20/07/18 17(29
If the script prompt you to provide the path to ORACLE_HOME directory, respond with:
instantclient,/usr/local/lib
touch $(brew --prefix php52)/lib/php/.lock && chmod 0644 $(brew --prefix php52)/lib/php/.lock # phpv5.2
touch $(brew --prefix php56)/lib/php/.lock && chmod 0644 $(brew --prefix php56)/lib/php/.lock # phpv5.6
touch $(brew --prefix php70)/lib/php/.lock && chmod 0644 $(brew --prefix php70)/lib/php/.lock # phpv7
And your are done, normally pecl will automatically load the extension in your php.ini . If not, add the following line to
your php.ini :
extension=oci8.so
mkdir -p /usr/local/lib/oracle/11.2.0.4/client
ln -sf /usr/local/instantclient/11.2.0.4/sdk/include /usr/local/lib/oracle/11.2.0.4/client/
cd /tmp
pecl download pdo_oci
tar -xvf PDO_OCI-1.0.tgz
cd PDO_OCI-1.0
wget
https://gist.githubusercontent.com/krisanalfa/e0beaa512b4677c51a7c/raw/214c36a65685c9c24102ad7b703d040a7fb60243/conf
https://gist.github.com/krisanalfa/09b765bb95012cd36fbd Page 2 of 6
Install OCI8 and / or PDO_OCI on OSX via Brew · GitHub 20/07/18 17(29
wget
https://gist.githubusercontent.com/krisanalfa/1bb09ad8f9147937bbeb/raw/b66ee62e8f4601a0f669e40a619881734787d4cd/pdo_
We should tell our configuration to use 11.2.0.4 version, so it will find the right version in our system.
phpize
./configure --with-pdo-oci=instantclient,/usr/local/lib,11.2.0.4
make
make install
extension=pdo_oci.so
Test it!
When you upgrade your PHP version, you'll find error about ldap.h . The solution is unlink the header file in /usr/local/include/ldap.h
unlink /usr/local/include/ldap.h
Trace/BPT trap: 5
I already downloaded the new Oracle client 12_1, installed the Xcode commandline tools, I have osx 10.11.5
https://gist.github.com/krisanalfa/09b765bb95012cd36fbd Page 3 of 6
Install OCI8 and / or PDO_OCI on OSX via Brew · GitHub 20/07/18 17(29
Can install at least version 2.0.12 of the PECL extension now for php56.
@leadebug @FraGoTe how did you solve the problem, I have the same error with client 12_1
I had to edit the configure file and add the 12.1 version. It's around line 5069
case clntsh in
c|c_r|pthread*) ;;
*)
if test "$ext_shared" = "yes"; then
PDO_OCI_SHARED_LIBADD="$PDO_OCI_SHARED_LIBADD -lclntsh"
else
case clntsh in
c|c_r|pthread*) ;;
*)
LIBS="$LIBS -lclntsh"
;;
esac
fi
;;
esac
;;
12.1)
https://gist.github.com/krisanalfa/09b765bb95012cd36fbd Page 4 of 6
Install OCI8 and / or PDO_OCI on OSX via Brew · GitHub 20/07/18 17(29
Hey guys, I updated this nice tutorial with the last version of OCI8 (12.1) here :
https://gist.github.com/alexbonhomme/0d5976f2126bcde34b817e0143be0dff
(with the fix of @kaizokou)
https://gist.github.com/krisanalfa/09b765bb95012cd36fbd Page 5 of 6
Install OCI8 and / or PDO_OCI on OSX via Brew · GitHub 20/07/18 17(29
Hello, @krisanalfa, you are creating symlinks just to feet PDO_OCI's config.m4 file statements? Could you explain please, the reason why
did you unzipped instantclient to /usr/local folder? I tried as you explained, but with no success.
any idea ??
https://gist.github.com/krisanalfa/09b765bb95012cd36fbd Page 6 of 6