Teradata driver for php compile error

Database
Enthusiast

Teradata driver for php compile error

Hi All, 

I am trying to compile the teradata driver for php based on these instructions

http://developer.teradata.com/print/197587

I am getting an error about a missing odbc.h file. Anybody run into this issue? 

I am using php 5.6.20 and the compile details are as follows

    cd /root/downloads/php-5.6.20 && \

    export ODBC_HOME=/opt/teradata/client/ODBC_32 && \

    export CPPFLAGS="-I$ODBC_HOME/include" && \

    export CUSTOM_ODBC_LIBS="-L$ODBC_HOME/lib -lodbc -lodbcinst" && \

    export LD_LIBRARY_PATH=/opt/teradata/client/15.10/odbc_64/lib:$LD_LIBRARY_PATH

    export LD_LIBRARY_PATH_64=/opt/teradata/client/15.10/odbc_64/lib:$LD_LIBRARY_PATH_64

    ./configure --prefix=/hosts/opt/php --enable-fastcgi --with-custom-odbc=$ODBC_HOME && \

    make && \

    make install && \

The configure fails with 

/bin/sh /root/downloads/php-5.6.20/libtool --silent --preserve-dup-deps --mode=compile cc -I/opt/teradata/client/ODBC_32/include -Iext/odbc/ -I/root/downloads/php-5.6.20/ext/odbc/ -DPHP_ATOM_INC -I/root/downloads/php-5.6.20/include -I/root/downloads/php-5.6.20/main -I/root/downloads/php-5.6.20 -I/root/downloads/php-5.6.20/ext/date/lib -I/root/downloads/php-5.6.20/ext/ereg/regex -I/usr/include/libxml2 -I/root/downloads/php-5.6.20/ext/sqlite3/libsqlite -I/root/downloads/php-5.6.20/TSRM -I/root/downloads/php-5.6.20/Zend  -I/opt/teradata/client/ODBC_32/include  -I/usr/include -g -O2 -fvisibility=hidden  -c /root/downloads/php-5.6.20/ext/odbc/php_odbc.c -o ext/odbc/php_odbc.lo 

In file included from /root/downloads/php-5.6.20/ext/odbc/php_odbc.c:37:0:

/root/downloads/php-5.6.20/ext/odbc/php_odbc_includes.h:183:18: fatal error: odbc.h: No such file or directory

 #include <odbc.h>

                  ^

compilation terminated.

make: *** [ext/odbc/php_odbc.lo] Error 1

[root@d8bd2332cd30 php-5.6.20]# 


Any help is appreciated.

Thanks,

Atilio

1 REPLY
Enthusiast

Re: Teradata driver for php compile error

By looking at some other posts,  I found some additional details and was able to compile successfully. Posting here the solution to my issue in case somebody runs into the same

 cd /root/downloads/php-5.6.20 && \

    export CPPFLAGS="-I/opt/teradata/client/15.10/include/" && \

    export ODBC_HOME=/opt/teradata/client/15.10/odbc_64/ && \

    export CPPFLAGS="-I/opt/teradata/client/15.10/include/" && \

    export CUSTOM_ODBC_LIBS="-L/opt/teradata/client/15.10/lib64/ -lodbc -lodbcinst" && \

    export LD_LIBRARY_PATH=/opt/teradata/client/15.10/odbc_64/lib:$LD_LIBRARY_PATH && \

    export LD_LIBRARY_PATH_64=/opt/teradata/client/15.10/odbc_64/lib:$LD_LIBRARY_PATH_64 && \

    echo "#include <odbcinst.h>" >> /usr/include/odbc.h && \

    echo "#include <sql.h>" >> /usr/include/odbc.h && \

    echo "#include <sqlext.h>" >> /usr/include/odbc.h && \

    echo "/usr/local/lib" >> /etc/ld.so.conf && \

    ./configure --prefix=/hosts/opt/php --enable-fastcgi --with-custom-odbc=$ODBC_HOME && \

    make && \

    make install && \