php: Unable to docker-php-ext-install odbc
The installation of the odbc php extension fails.
FROM php:5.6-fpm
MAINTAINER "Austin Maddox" <###@###.com>
RUN docker-php-ext-install odbc
Results in…
Sending build context to Docker daemon 6.276 MB
Sending build context to Docker daemon
Step 0 : FROM php:5.6-fpm
---> 6e868825957f
Step 1 : MAINTAINER "Austin Maddox" <###@###.com>
---> Using cache
---> 481c0cc76869
Step 2 : RUN docker-php-ext-install odbc
---> Running in fa4294a61b70
+ cd /usr/src/php/ext/odbc
+ phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
+ ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
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!
Removing intermediate container fa4294a61b70
INFO[0002] The command [/bin/sh -c docker-php-ext-install odbc] returned a non-zero code: 1
Is there something I’m missing? Is there a package dependency that needs to be installed first or something? I’ve tried installing php5-odbc, unixODBC, unixODBC-dev and nothing helps.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 31 (20 by maintainers)
Commits related to this issue
- Install odbc php extention https://github.com/docker-library/php/issues/103\#issuecomment-271413933. — committed to robertoperuzzo/php-as400 by deleted user 3 years ago
- Testing workaround https://github.com/docker-library/php/issues/103\#issuecomment-252818563. — committed to robertoperuzzo/php-as400 by deleted user 3 years ago
- Testing https://github.com/docker-library/php/issues/103\#issuecomment-271413933'. — committed to robertoperuzzo/php-as400 by deleted user 3 years ago
- Testing https://github.com/docker-library/php/issues/103\#issuecomment-271413933'. — committed to robertoperuzzo/php-as400 by deleted user 3 years ago
The following builds successfully:
Thank you. Although not very elegant, this does seem to work…
I am able to make odbc connections now. 👍
I’m not sure if I should be concerned, but if I produce a
phpinfo()
in the aforementionedphp:5.6-fpm
container theODBC library
,ODBC_INCLUDE
,ODBC_LFLAGS
,ODBC_LIBS
all have no value.Whereas in another
php:5.6-apache
container I have running, those values are defined…@munir3011 sounds like you aren’t using this Docker image (we have no CentOS-based variants, and this repo doesn’t have anything specific to do with FreePBX) 😉
Regarding the original issue described here, I think the workaround we discovered (https://github.com/docker-library/php/issues/103#issuecomment-271434109) is probably the best we’re going to find (given how this particular extension functions), so I’m going to close, but I think this discussion should serve as a good reference point for future users who need ODBC in their
php
-based images. 👍 ❤️For the sake of future travelers, the workaround in question (https://github.com/docker-library/php/issues/103#issuecomment-271434109) referenced again:
hi plz help me sir problem i have using sentos 6.7 freepbx problem is in dashboard monthly and daily CALLS INFO TODAY not showing monthly call report not showing today recent call report no showing
I had the same issue for php 7. This version works for me:
@tylkomat perhaps you need
pdo_odbc
?I also connect to DB2 from one of my applications (see full Dockerfile), but with IBM i Access for Linux rather than the ibm_db2 extension. Just sharing in case other people using ODBC connections to DB2 find it useful.
Not sure why the
sed
is necessary here, but I got this working. @yosifkit tested compiling it directly into PHP, and it doesn’t have any of these issues, so this is extra bizarre.