Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 1 ERROR: `make' failed when installing sqlsrv

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

like image 602
Edeholland Avatar asked May 24 '17 08:05

Edeholland


2 Answers

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.

Possibly, a better explanation is here. stackoverflow Question # 15447386

like image 147
Matthew Goheen Avatar answered Oct 05 '22 18:10

Matthew Goheen


I had the following error on Ubuntu 18.04 when installing

/tmp/pear/temp/sqlsrv/shared/xplat.h:30:10: fatal error: sql.h: No such file or directory #include <sql.h>

Installing the package unixodbc-dev as Matthew Goheen proposed solved the issue

sudo apt-get install unixodbc-dev
like image 34
Vindic Avatar answered Oct 05 '22 18:10

Vindic