사용자 도구

사이트 도구


develop:php:oci8_install

문서의 이전 판입니다!


Enabling the php oci8

Oracle Installed

설치되어 있는 오라클 정보이다.

ORACLE_BASE /u01/app/oracle
ORACLE_HOME $ORACLE_BASE/product/10.2.0
LD_LIBRARY_PATH $ORACLE_HOME/lib:$ORACLE_HOME/jdbc/lib
  1. 오라클 환경변수를 확인한다.
    # 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"

OCI8 Install

  1. http://pecl.php.net/package/oci8 에서 최신버젼을 다운로드 받는다.
    $ wget http://pecl.php.net/get/oci8-2.1.8.tgz
  2. 압축을 해제한다.
    $ tar xvfz oci8-2.1.8.tgz
  3. 소스경로로 이동한다.
    $ cd oci8-2.1.8/
  4. PHP 확장모듈을 위한 빌드환경을 만들기 위해 phpize 를 실행한다.
    $ phpize
  5. libclntsh.so 경로를 확인한다.
    $ ls $ORACLE_HOME/lib/libclntsh.so
    /u01/app/oracle/product/10.2.0/lib/libclntsh.so
    or
    $ ls $ORACLE_HOME/libclntsh.so
    /usr/local/instantclient_11_2/libclntsh.so
  6. 환경설정을 맞춰서 컴파일을 한다.
    –with-oci8 에 상황에 맞게 shared 와 instantclient 를 붙여준다.
    $ ./configure --with-oci8=$ORACLE_HOME (default)
    $ ./configure --with-oci8=instantclient,$ORACLE_HOME
    $ ./configure --with-oci8=shared,instantclient,$ORACLE_HOME
  7. make
    $
  8. make install 를 실행한다.
    root가 아닐 경우 퍼미션 에러가 날 수 있다, 이때에는 sudo 를 같이 써준다.
    $ 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/
develop/php/oci8_install.1535115240.txt.gz · 마지막으로 수정됨: 2018/08/24 21:54 저자 starlits