Trying to deploy a PHP Azure "App Service" app, which connects to a SQL Server database
I have to add the sqlsrv and sqlsrv_pdo packages by running pecl install pdo_sqlsrv
and pecl install sqlsrv`
Other threads have mentioned adding apt-get install unixodbc-dev
, I have done so, but it does not help
Here is the error I'm getting below
creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-rootiNpTPo/pdo_sqlsrv-5.10.1/libtool --mode=compile g++ -I. -I/tmp/pear/temp/pdo_sqlsrv -I/tmp/pear/temp/pear-build-rootiNpTPo/pdo_sqlsrv-5.10.1/include -I/tmp/pear/temp/pear-build-rootiNpTPo/pdo_sqlsrv-5.10.1/main -I/tmp/pear/temp/pdo_sqlsrv -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 -I/tmp/pear/temp/pdo_sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -I/usr/local/include/php/ext -std=c++11 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/pdo_sqlsrv/pdo_dbh.cpp -o pdo_dbh.lo -MMD -MF pdo_dbh.dep -MT pdo_dbh.lo
g++ -I. -I/tmp/pear/temp/pdo_sqlsrv -I/tmp/pear/temp/pear-build-rootiNpTPo/pdo_sqlsrv-5.10.1/include -I/tmp/pear/temp/pear-build-rootiNpTPo/pdo_sqlsrv-5.10.1/main -I/tmp/pear/temp/pdo_sqlsrv -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 -I/tmp/pear/temp/pdo_sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -I/usr/local/include/php/ext -std=c++11 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/pdo_sqlsrv/pdo_dbh.cpp -MMD -MF pdo_dbh.dep -MT pdo_dbh.lo -fPIC -DPIC -o .libs/pdo_dbh.o
In file included from /tmp/pear/temp/pdo_sqlsrv/php_pdo_sqlsrv_int.h:23,
from /tmp/pear/temp/pdo_sqlsrv/pdo_dbh.cpp:24:
/tmp/pear/temp/pdo_sqlsrv/shared/core_sqlsrv.h:48:10: fatal error: config.h: No such file or directory
48 | #include "config.h"
| ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:205: pdo_dbh.lo] Error 1
ERROR: `make' failed
I was expecting the pecl package to run... actually I was expecting the Microsoft App Service linux box to support MS Sql Server by default, but you get what I'm saying