OSX High Sierra 에 오라클 인스턴트 클라이언트 및 oci8 설치



1. 오라클 사이트에서 아래 3개 파일 다운로드


instantclient-basic-maxos.x64-12.2.0.1.zip

instantclient-sqlplus-maxos.x64-12.2.0.1.zip

instantclient-sdk-maxos.x64-12.2.0.1.zip


2. 압축을 푼다.


/usr/local/instantclient/12.2.0.1 폴더에 모든 압축을 풀어 놓는다.


폴더 구조는 아래와 같다.


-rw-rw-rw-@ 1 ellord  staff        400 Jan  9 23:52 BASIC_README

-rw-rw-rw-@ 1 ellord  staff        404 Jan  9 23:53 SQLPLUS_README

-rwxrwxrwx@ 1 ellord  staff      10036 Jan  9 23:52 adrci

-rwxrwxrwx@ 1 ellord  staff      40360 Jan  9 23:52 genezi

-r-xr-xr-x@ 1 ellord  staff        342 Apr 24  2015 glogin.sql

lrwxr-xr-x@ 1 ellord  staff         20 May 31 23:28 libclntsh.dylib -> libclntsh.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff   85621532 Jan  9 23:51 libclntsh.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff    4685408 Jan  9 23:51 libclntshcore.dylib.12.1

-r-xr-xr-x@ 1 ellord  staff    8179072 Jun 28  2017 libnnz12.dylib

lrwxr-xr-x@ 1 ellord  staff         18 May 31 23:28 libocci.dylib -> libocci.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff    1465312 Jan  9 23:44 libocci.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff  124769196 Jan  9 23:52 libociei.dylib

-r-xr-xr-x@ 1 ellord  staff     151748 Aug  8  2017 libocijdbc12.dylib

-r-xr-xr-x@ 1 ellord  staff     237780 Jan  8 05:33 libons.dylib

-rwxrwxrwx@ 1 ellord  staff      84988 Jan  9 23:40 liboramysql12.dylib

-rwxrwxrwx@ 1 ellord  staff    1267088 Jan  9 23:13 libsqlplus.dylib

-r-xr-xr-x@ 1 ellord  staff    1639388 Jul 12  2017 libsqlplusic.dylib

-r--r--r--@ 1 ellord  staff    4036257 Dec 13  2016 ojdbc8.jar

drwxrwxrwx@ 8 ellord  staff        256 Jan  9 23:53 sdk

-rwxr-xr-x@ 1 ellord  staff       8480 Jan  9 23:53 sqlplus

-rwxrwxrwx@ 1 ellord  staff     146084 Jan  9 23:52 uidrvci

-r--r--r--@ 1 ellord  staff      74230 Jan 26  2017 xstreams.jar



3. 링크를 걸어준다.


sudo ln -sF /usr/local/instantclient/12.2.0.1/sdk/include/*.h /usr/local/include/

sudo ln -sF /usr/local/instantclient/12.2.0.1/sqlplus /usr/local/bin/

sudo ln -sF /usr/local/instantclient/12.2.0.1/*.dylib /usr/local/lib/

sudo ln -sf /usr/local/instantclient/12.2.0.1/*.dylib.12.1 /usr/local/lib/

sudo ln -sF /usr/local/lib/libclntsh.dylib.12.1 /usr/local/lib/libclntsh.dylib





4. sqlplus로 오라클 서버에 접속해 본다.


sudo /usr/local/bin/sqlplus 유저명/비밀번호@서버IP:port/SID




5. pecl로 oci8 설치



sudo pecl install oci8-2.0.10    #php 5.x


sudo pecl install oci8                #php 7


입력창에서 아래와 같이 입력하고 엔터


instantclient,/usr/local/lib




sh-3.2# pecl install oci8


Warning: Declaration of PEAR_Installer::download($packages, $options, &$config, &$installpackages, &$errors, $installed = false, $willinstall = false, $state = false) should be compatible with & PEAR_Downloader::download($params) in Installer.php on line 43


Warning: Declaration of PEAR_Installer::download($packages, $options, &$config, &$installpackages, &$errors, $installed = false, $willinstall = false, $state = false) should be compatible with & PEAR_Downloader::download($params) in /usr/local/pear/share/pear/PEAR/Installer.php on line 43

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update

downloading oci8-2.1.8.tgz ...

Starting to download oci8-2.1.8.tgz (194,154 bytes)

.....done: 194,154 bytes


Warning: Declaration of & PEAR_PackageFile_Parser_v2::parse($data, $file, $archive = false, $class = 'PEAR_Packa...') should be compatible with PEAR_XMLParser::parse($data) in v2.php on line 113


Warning: Declaration of & PEAR_PackageFile_Parser_v2::parse($data, $file, $archive = false, $class = 'PEAR_Packa...') should be compatible with PEAR_XMLParser::parse($data) in /usr/local/pear/share/pear/PEAR/PackageFile/Parser/v2.php on line 113


Warning: Declaration of PEAR_Builder::log($level, $msg) should be compatible with PEAR_Common::log($level, $msg, $append_crlf = true) in Builder.php on line 489


Warning: Declaration of PEAR_Builder::log($level, $msg) should be compatible with PEAR_Common::log($level, $msg, $append_crlf = true) in /usr/local/pear/share/pear/PEAR/Builder.php on line 489

11 source files, building

running: phpize

Configuring for:

PHP Api Version:         20160303

Zend Module Api No:      20160303

Zend Extension Api No:   320160303

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,/usr/local/lib

building in /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8

running: /private/tmp/pear/install/oci8/configure --with-oci8=instantclient,/usr/local/lib

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 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 whether cc understands -c and -o together... yes

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-apple-darwin17.5.0

checking host system type... x86_64-apple-darwin17.5.0

checking target system type... x86_64-apple-darwin17.5.0

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/lib/php/extensions/no-debug-non-zts-20160303

checking for PHP installed headers prefix... /usr/include/php

checking if debug is enabled... no

checking if zts is enabled... no

checking for re2c... no

configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

checking for gawk... no

checking for nawk... no

checking for awk... awk

checking if awk is broken... no

checking for Oracle Database OCI8 support... yes, shared

checking PHP version... 7.1.14, ok

checking OCI8 DTrace support... no

checking size of long int... 8

checking checking if we're on a 64-bit platform... yes

checking Oracle Instant Client directory... /usr/local/lib

checking Oracle Instant Client SDK header directory... /usr/local/include

checking Oracle Instant Client library version compatibility... 12.1

checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld

checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no

checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r

checking for BSD-compatible nm... /usr/bin/nm -B

checking whether ln -s works... yes

checking how to recognize dependent libraries... pass_all

checking dlfcn.h usability... yes

checking dlfcn.h presence... yes

checking for dlfcn.h... yes

checking the maximum length of command line arguments... 196608

checking command to parse /usr/bin/nm -B output from cc object... ok

checking for objdir... .libs

checking for ar... ar

checking for ranlib... ranlib

checking for strip... strip

checking for dsymutil... dsymutil

checking for nmedit... nmedit

checking for -single_module linker flag... yes

checking for -exported_symbols_list linker flag... yes

checking if cc supports -fno-rtti -fno-exceptions... yes

checking for cc option to produce PIC... -fno-common

checking if cc PIC flag -fno-common works... yes

checking if cc static flag -static works... no

checking if cc supports -c -o file.o... yes

checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes

checking dynamic linker characteristics... darwin17.5.0 dyld

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... no


creating libtool

appending configuration tag "CXX" to libtool

configure: creating ./config.status

config.status: creating config.h

running: make

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8.c -o oci8.lo

mkdir .libs

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8.c  -fno-common -DPIC -o .libs/oci8.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_lob.c -o oci8_lob.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_lob.c  -fno-common -DPIC -o .libs/oci8_lob.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_statement.c -o oci8_statement.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_statement.c  -fno-common -DPIC -o .libs/oci8_statement.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_collection.c -o oci8_collection.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_collection.c  -fno-common -DPIC -o .libs/oci8_collection.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_interface.c -o oci8_interface.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_interface.c  -fno-common -DPIC -o .libs/oci8_interface.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_failover.c -o oci8_failover.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_failover.c  -fno-common -DPIC -o .libs/oci8_failover.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/oci8 -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 -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -o oci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/modules  oci8.lo oci8_lob.lo oci8_statement.lo oci8_collection.lo oci8_interface.lo oci8_failover.lo -Wl,-rpath,/usr/local/lib -L/usr/local/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/usr/local/lib -lclntsh  -Wl,-rpath -Wl,/usr/local/lib

dsymutil .libs/oci8.so || :

creating oci8.la

(cd .libs && rm -f oci8.la && ln -s ../oci8.la oci8.la)

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=install cp ./oci8.la /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/modules

cp ./.libs/oci8.so /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/modules/oci8.so

cp ./.libs/oci8.lai /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/modules/oci8.la

----------------------------------------------------------------------

Libraries have been installed in:

   /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/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'.


running: make INSTALL_ROOT="/private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8" install

Installing shared extensions:     /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions/no-debug-non-zts-20160303/

running: find "/private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8" | xargs ls -dils

14107085   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8

14107435   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr

14107436   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib

14107437   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php

14107438   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions

14107439   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions/no-debug-non-zts-20160303

14107440 352 -rwxr-xr-x  1 root  wheel  176164 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions/no-debug-non-zts-20160303/oci8.so


Build process completed successfully

Installing '/usr/lib/php/extensions/no-debug-non-zts-20160303/oci8.so'




6. /usr/lib/php/extensions/no-debug-non-zts-20160303/ 위치에 oci8.so 가 만들어졌다.




7. MAMP php extensions에 oci8.so 추가


/Applications/MAMP/bin/php/php7.1.8/lib/php/extensions/oci8.so





8. MAMP를 재시작하고 phpinfo를 찍어본다.






9. 끝.



 





블로그 이미지

엘로드넷

,