Overview
This document is for integrating Altibase with UNIX_ODBC.
Version
All the versions of ALTIBASE HDB
UNIX ODBC type and URL
unix_odbc is an open source project, and unixODBC is mainly used.
- unixODBC can be downloaded from the link below:
- http://unixodbc.org/
INSTALL
$ mkdir $HOME/ODBC_HOME
$ gzip -d unixODBC-2.3.2.tar.gz
$ tar -xvf unixODBC-2.3.2.tar
$ cd unixODBC-2.3.2
$ cd $ALTIBASE_HOME/lib
PHP, PERL Integration
PHP, PERL, etc. support unix_odbc, so it can be integrated with Altibase in the above way.
PHP Integration Guide
Setting related environment variables
Be sure to set the following variables in advance.
export CFLAGS=-DBUILD_LEGACY_64_BIT_MODE=1
export ODBCINI=odbc.ini File location path
export LD_LIBRARY_PATH=$APACHE_HOME/modules:unixODBC설치경로/lib:PHPinstallationpath/lib
Check SQLLEN, SQLULEN
Move to the bin directory of the nixODBC installation path and use the odbcinst command to check whether SQLLEN size and SQLULEN size are 4.
In case of 4, it is set to 32bit, and in case of 8, it is set to 64bit.
$ ./odbcinst -j
unixODBC 2.3.2
DRIVERS............: /home/altibase/phptest/unixodbc/etc/odbcinst.ini
SYSTEM DATA SOURCES: /home/altibase/phptest/unixodbc/etc/odbc.ini
FILE DATA SOURCES..: /home/altibase/phptest/unixodbc/etc/ODBCDataSources
USER DATA SOURCES..: /home/altibase/phptest/unixodbc/etc/odbc.ini
SQLULEN Size.......: 4
SQLLEN Size........: 4 <—If 4, 32 bit. If 8, 64bit.
SQLSETPOSIROW Size.: 2
Modify unixODBC's odbc.ini file
It can be set to process lob data by adding LongDataCompat=ON to the odbc.ini file.
PHP compilation and installation operation
$> ./configure \
--prefix=/user/web/php \
--with-config-file-path=/user/web/php/conf \
--with-apxs2=/user/web/apache2/bin/apxs \
--with-unixODBC=/user/web/odbc \
--with-mcrypt \
--with-mhash \
--with-openssl \
--with-kerberos \
--with-curl \
--enable-dom \
--with-iconv=/usr/local \
--with-xmlrpc \
--enable-libxml \
--with-libxml-dir=/usr/lib64 \
--with-gd \
--with-freetype-dir=/usr \
--with-jpeg-dir=/usr/lib64 \
--with-png-dir=/usr/lib64 \
--with-zlib-dir=/usr/lib64 \
--enable-mbstring \
--enable-shmop \
--enable-sockets \
--enable-sigchild \
--enable-soap \
--enable-zip \
--enable-ftp \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-regex=php \
--with-pcre-regex \
--enable-mbregex \
--enable-dba=shared \
--enable-mod-charset \
--with-xml \
--with-pcre \
--with-gdbm \
--with-dbm$> make
$> make installphp.ini settings
memory_limit=-1
odbc.defaultbinmode=1
odbc.defaultlrl=1048576