CentOS 5.5 + PHP 5.3.10, I’ve built the latest unixODBC 2.3.2 from source to /usr/local/unixODBC.
I need to add php-odbc to my php’s extension list, as what I did, phpize && configure && make, but error occurred:
1 2 3 4 |
# ./configure --with-unixODBC=/usr/local/unixODBC/ --with-php-config=/usr/local/php/bin/php-config ... checking for Adabas support... cp: cannot stat `/usr/local/lib/odbclib.a': No such file or directory configure: error: ODBC header file '/usr/local/incl/sqlext.h' not found! |
I tried to add ‘–with-adabas=no‘, but failed.
The solution is, DELETE all configs like
1 |
if test -z "$ODBC_TYPE"; then |
and leave the
1 2 3 |
if test -z "$ODBC_TYPE"; then PHP_ARG_WITH(unixODBC,, [ --with-unixODBC[=DIR] Include unixODBC support [/usr/local]]) |
block in config.m4.
Then phpize, configure, make.
For pdo_odbc, configure may like
1 |
./configure --with-pdo-odbc=unixODBC,/usr/local/unixODBC/ --with-php-config=/usr/local/php/bin/php-config |
Build Old PHP-ODBC from Source by @sskaje: https://sskaje.me/2014/07/build-php-odbc-source/
Incoming search terms:
Link to this post!