...
Info |
---|
prefix: The path to install unixODBC If the enable-threads option is set to no, the following error may occur when testing the connection with isql. $ ./isql Altiodbc ./isql: symbol lookup error: /home/wonsik/altibase_home/lib/libaltibase_odbc-64bit-ul64.so: undefined symbol: pthread_sigmask $ ./isql Altiodbc ./isql: symbol lookup error: /home/wonsik/altibase_home/lib/libaltibase_odbc-64bit-ul64.so: undefined symbol: pthread_sigmask |
Panel | |
---|---|
Panel | $ make $ make install $ cd ODBC_HOME $ dltest $ALTIBASE_HOME/lib/libaltibase_odbc-64bit-ul64.so SUCCESS: Loaded /home/wonsik/altibase_home/lib/libaltibase_odbc-64bit-ul64.so $ cat odbc.ini [ODBC Data Sources] Altiodbc = Altibase ODBC Driver [Altiodbc] Driver = /home/wonsik/altibase_home/lib/libaltibase_odbc-64bit-ul64.so Description = Sample Altibase DSN UserName = SYS Password = MANAGER ServerType = Altibase Server = 127.0.0.1 User = SYS Port = 40501 Database = mydb FetchBufferSize = 64 ReadOnly = no TraceFile = /home/wonsik/ODBC_HOME/odbc.trace Trace = 0 Trace option means 1 (debug), 0 (normal) $ export ODBCINI=/home/wonsik/odbc.ini $ cd $HOME/ODBC_HOME/bin $ odbc_config --ulen -DSIZEOF_SQLULEN=8 $ ./isql Altiodbc +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
|
PHP, PERL Integration
...
PHP, PERL, etc. support unix_odbc, so it can be integrated with Altibase in the above way.
...
Setting related environment variables
Panel 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:PHP설치경로PHPinstallationpath/lib
Check SQLLEN, SQLULEN
Panel 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
Panel It can be set to process lob data by adding LongDataCompat=ON to the odbc.ini file.
PHP compilation and installation operation
Panel $> ./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
Panel memory_limit=-1
odbc.defaultbinmode=1
odbc.defaultlrl=1048576