none
Error installing sqlsrv driver in Linux RRS feed

  • Question

  • When I try to install the driver in Ubuntu 16.04 I get the following error:

    dtz-dany Install SQLSRV # pecl install sqlsrv
    downloading sqlsrv-4.3.0.tgz ...
    Starting to download sqlsrv-4.3.0.tgz (164,282 bytes)
    ....................................done: 164,282 bytes
    33 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20151012
    Zend Module Api No:      20151012
    Zend Extension Api No:   320151012
    building in /tmp/pear/temp/pear-build-rootKnDjzP/sqlsrv-4.3.0
    running: /tmp/pear/temp/sqlsrv/configure --with-php-config=/usr/bin/php-config
    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-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking target system type... x86_64-pc-linux-gnu
    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib
    checking for PHP extension directory... /usr/lib/php/20151012
    checking for PHP installed headers prefix... /usr/include/php/20151012
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking whether to enable sqlsrv functions... yes, shared
    checking for SQLSRV headers... /tmp/pear/temp/sqlsrv/shared/
    checking for g++... no
    checking for c++... no
    checking for gpp... no
    checking for aCC... no
    checking for CC... no
    checking for cxx... no
    checking for cc++... no
    checking for cl.exe... no
    checking for FCC... no
    checking for KCC... no
    checking for RCC... no
    checking for xlC_r... no
    checking for xlC... no
    checking whether we are using the GNU C++ compiler... no
    checking whether g++ accepts -g... no
    checking how to run the C++ preprocessor... /lib/cpp
    configure: error: in `/tmp/pear/temp/pear-build-rootKnDjzP/sqlsrv-4.3.0':
    configure: error: C++ preprocessor "/lib/cpp" fails sanity check
    See `config.log' for more details
    ERROR: `/tmp/pear/temp/sqlsrv/configure --with-php-config=/usr/bin/php-config' failed
    

    I followed the Linux_4.0_Install_Instructions.pdf manual and the problem persists.

    What I can do?

    Thank you

    Tuesday, July 11, 2017 8:21 PM

All replies

  • refer following link and do step by step.

    http://php.net/manual/en/sqlsrv.installation.php


    Please Mark it as Answered if it answered your question OR mark it as Helpful if it help you to solve your problem.


    • Edited by AV111 Tuesday, July 11, 2017 8:44 PM
    Tuesday, July 11, 2017 8:41 PM
  • Problem still not resolved

    I will download https://github.com/Microsoft/msphpsql/releases/download/v4.3.0/Ubuntu16-7.0.tar to manually install the driver.

    I can not install with pecl install sqlsrv

    Tuesday, July 11, 2017 9:58 PM
  • Did this resolve your issue?

    I am having the same issue

    Wednesday, October 4, 2017 12:02 PM
  • This link might be able to answer your question.

    https://askubuntu.com/a/509671/687892 "C++ preprocessor “/lib/cpp” fails sanity check"

    It involves installing g++, which might help when you see this error, by using:

    apt-get install g++

    At least that's what got my offline ubuntu 16.04 working.

    • Edited by oopoopoop Wednesday, October 25, 2017 12:13 PM
    • Proposed as answer by oopoopoop Thursday, October 26, 2017 2:26 AM
    Wednesday, October 25, 2017 12:08 PM
  • This link might be able to answer your question.

    https://askubuntu.com/a/509671/687892 "C++ preprocessor “/lib/cpp” fails sanity check"

    It involves installing g++, which might help when you see this error, by using:

    apt-get install g++

    At least that's what got my offline ubuntu 16.04 working.

    Thanks, it solved my problem
    • Proposed as answer by AV111 Tuesday, October 29, 2019 5:21 PM
    Friday, September 27, 2019 12:54 PM