msphpsql: unable to install version 4.0.7+ on ubuntu 16.04 using pecl
Hi, I’m trying to install sqlsrv and pdo_sqlsrv using pecl on php 7.0.14 however it fails with an error. I was also following the tutorial at https://www.microsoft.com/en-us/sql-server/developer-get-started/php-ubuntu Is anyone else experiencing the same issue?
The latest installable version for me is 4.0.6 and here’s the part from pecl output
running: make
/bin/sh /tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/conn.cpp -o conn.lo
mkdir .libs
g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/conn.cpp -fPIC -DPIC -o .libs/conn.o
/tmp/pear/temp/sqlsrv/conn.cpp:152:75: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
char* ss_sqlsrv_conn::resource_name = static_cast<char *>("ss_sqlsrv_conn");
^
/bin/sh /tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/util.cpp -o util.lo
g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/util.cpp -fPIC -DPIC -o .libs/util.o
/bin/sh /tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/init.cpp -o init.lo
g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/init.cpp -fPIC -DPIC -o .libs/init.o
In file included from /root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main/php_ini.h:24:0,
from /root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main/fopen_wrappers.h:26,
from /root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main/php.h:390,
from /tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:34,
from /tmp/pear/temp/sqlsrv/php_sqlsrv.h:25,
from /tmp/pear/temp/sqlsrv/init.cpp:19:
/tmp/pear/temp/sqlsrv/init.cpp: In function ‘int zm_activate_sqlsrv(int, int)’:
/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend/zend_ini.h:142:37: note: in expansion of macro ‘INI_INT’
#define INI_BOOL(name) ((zend_bool) INI_INT(name))
^
/tmp/pear/temp/sqlsrv/init.cpp:639:45: note: in expansion of macro ‘INI_BOOL’
SQLSRV_G( warnings_return_as_errors ) = INI_BOOL( INI_PREFIX INI_WARNINGS_RETURN_AS_ERRORS);
^
/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/tmp/pear/temp/sqlsrv/init.cpp:640:32: note: in expansion of macro ‘INI_INT’
SQLSRV_G( log_severity ) = INI_INT( INI_PREFIX INI_LOG_SEVERITY);
^
/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/tmp/pear/temp/sqlsrv/init.cpp:641:34: note: in expansion of macro ‘INI_INT’
SQLSRV_G( log_subsystems ) = INI_INT( INI_PREFIX INI_LOG_SUBSYSTEMS);
^
/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend/zend_ini.h:139:62: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
#define INI_INT(name) zend_ini_long((name), sizeof(name)-1, 0)
^
/tmp/pear/temp/sqlsrv/init.cpp:642:40: note: in expansion of macro ‘INI_INT’
SQLSRV_G( buffered_query_limit ) = INI_INT( INI_PREFIX INI_BUFFERED_QUERY_LIMIT);
^
/bin/sh /tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/stmt.cpp -o stmt.lo
g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/stmt.cpp -fPIC -DPIC -o .libs/stmt.o
/tmp/pear/temp/sqlsrv/stmt.cpp:31:75: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
char* ss_sqlsrv_stmt::resource_name = static_cast<char *>("ss_sqlsrv_stmt"); // not const for a reason. see sqlsrv_stmt in php_sqlsrv.h
^
/bin/sh /tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/include -I/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/main -I/tmp/pear/temp/sqlsrv -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/main -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/TSRM -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/Zend -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext -I/root/.phpbrew/php/phpbrew7.0.14.dev/include/php/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -g -O0 -std=c++11 -c /tmp/pear/temp/sqlsrv/shared/core_conn.cpp -o shared/core_conn.lo
/tmp/pear/temp/pear-build-rootbDXuVK/sqlsrv-4.0.8/libtool: line 1283: shared/core_conn.loT: No such file or directory
mkdir shared/.libs
mkdir: cannot create directory 'shared/.libs': No such file or directory
Makefile:202: recipe for target 'shared/core_conn.lo' failed
make: *** [shared/core_conn.lo] Error 1
ERROR: `make' failed
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 29 (9 by maintainers)
I have the same error, I could solve the issue with installing
sudo apt install unixodbc-devAfter this I was able to installsqlsrvandpdo_sqlsrvwithout any problems.I suspect unixODBC is not properly installed in your machine. Please post the output of the following commands:
@meet-bhagdev , I actually came across this issue today when attempting to install sqlsrv-4.0.8 on a docker image from pecl. I updated to 4.1.6.1 and the fail did not occur.
Cheers.
@GodWolen @bla-kw @ioweb-gr Can you try the latest PECL package (4.1.6.1)?
sudo pecl install sqlsrv-4.1.6.1@GodWolen Seems like there in an issue with our 4.0.6+ PECL packages. We are looking into this actively.