# apt-get install build-essential libaio1
# apt-get install libapache2-mod-php7.2 php7.2 php7.2-dev apache2
ubuntu 16.04 일 경우에는 아래의 명령어로 설치
# apt-get install libapache2-mod-php7.0 php7.0 php7.0-dev apache2
ORACLE_BASE | /usr/local/instantclient_11_2 |
---|---|
ORACLE_HOME | /usr/local/instantclient_11_2 |
LD_LIBRARY_PATH | /usr/local/instantclient_11_2 |
# vi /etc/bash_completion.d/oracle export ORACLE_BASE="/usr/local/instantclient_11_2" export ORACLE_HOME="/usr/local/instantclient_11_2" export LD_LIBRARY_PATH="/usr/local/instantclient_11_2"
... LD_LIBRARY_PATH=/usr/local/instantclient_11_2:$LD_LIBRARY_PATH
echo /usr/local/instantclient_11_2 > /etc/ld.so.conf.d/oracle-instantclient.conf
$ wget http://pecl.php.net/get/oci8-2.1.8.tgz
$ tar xvfz oci8-2.1.8.tgz
$ cd oci8-2.1.8/
$ phpize
# oracle server 설정 $ ls $ORACLE_HOME/lib/libclntsh.so /u01/app/oracle/product/10.2.0/lib/libclntsh.so or # oracle instant client 설정 $ ls $ORACLE_HOME/libclntsh.so /usr/local/instantclient_11_2/libclntsh.so
링크가 제대로 존재하는지 확인
$ cd $ORACLE_HOME $ ln -s /usr/local/instantclient_11_2/libocci.so.11.1 libocci.so $ ln -s /usr/local/instantclient_11_2/libclntsh.so.11.1 libclntsh.so
$ ./configure --with-oci8=$ORACLE_HOME (default) $ ./configure --with-oci8=instantclient,$ORACLE_HOME $ ./configure --with-oci8=shared,instantclient,$ORACLE_HOME
–with-oci8=instantclient,$ORACLE_HOME 으로 진행
$ make
$ make install $ sudo make install [sudo] password for starlits: /bin/bash /home/starlits/src/opensources/oci8-2.0.8/libtool --mode=install cp ./oci8.la /home/starlits/src/opensources/oci8-2.0.8/modules libtool: install: cp ./.libs/oci8.so /home/starlits/src/opensources/oci8-2.0.8/modules/oci8.so libtool: install: cp ./.libs/oci8.lai /home/starlits/src/opensources/oci8-2.0.8/modules/oci8.la libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/sbin" ldconfig -n /home/starlits/src/opensources/oci8-2.0.8/modules ---------------------------------------------------------------------- Libraries have been installed in: /home/starlits/src/opensources/oci8-2.0.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 `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. ---------------------------------------------------------------------- Installing shared extensions: /usr/lib/php5/20090626+lfs/
# vi /etc/php/7.2/apache2/php.ini ... ;extension=oci8_12c ; Use with Oracle Database 12c Instant Client ;extension=odbc ;extension=openssl ;extension=pdo_firebird ;extension=pdo_mysql ;extension=pdo_oci ;extension=pdo_odbc ;extension=pdo_pgsql ;extension=pdo_sqlite ;extension=pgsql ;extension=shmop extension=oci8 ...
# vi /etc/php/7.2/cli/php.ini ... extension=oci8 ..
# php -m | grep oci8 oci8