I'm trying to install sqlsrv by using the commands from this page. However, when running
pecl install sqlsrv-4.2.0preview
I get the error: Error 1 ERROR: 'make' failed
.
I tried :
apt-get update
apt-get install build-essential
apt-get install libpcre3-dev
apt-get install make
All of these are installed on the latest version.
I'm running a container using the php:7.0-apache image. Running apachectl -V
returns Apache/2.4.10 (Debian)
.
Here is the full log output from the command I ran: https://pastebin.com/MYDY3xwU
I had this exact error.
/tmp/pear/temp/sqlsrv/shared/xplat.h:30:17: fatal error: sql.h: No such file or directory
#include <sql.h>
Apparently the header file its looking for is only in the package unixODBC-devel.
I installed that package and was able to successfully complete the build. yum install unixODBC-devel
.
If you are on a system with apt instead of yum, apt install unixodbc-dev
Possibly, a better explanation is here. stackoverflow Question # 15447386