msphpsql: conn.lo error

First time installation for sqlsrv and pdo_sqlsrv

using microsoft azure sql server

using rasparian (Debian 8)

php 7.0

im receiving conn.lo error In file included from /usr/include/sql.h:19:0, from /tmp/pear/temp/sqlsrv/shared/xplat.h:30, from /tmp/pear/temp/sqlsrv/shared/typedefs_for_linux.h:23, from /tmp/pear/temp/sqlsrv/shared/xplat_winnls.h:24, from /tmp/pear/temp/sqlsrv/shared/FormattedPrint.h:24, from /tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:41, from /tmp/pear/temp/sqlsrv/php_sqlsrv.h:25, from /tmp/pear/temp/sqlsrv/conn.cpp:20: /usr/include/sqltypes.h:251:33: note: previous declaration as 'typedef long unsigned int UDWORD' typedef unsigned long int UDWORD; ^ Makefile:194: recipe for target 'conn.lo' failed The so should install but instead it shows code error.

When run this sudo pecl install sqlsrv pdo_sqlsrv command

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I got the same error that @marufmax got, just remember to install

# optional: for unixODBC development headers
sudo apt-get install unixodbc-dev

After that, it worked. !

As @david-puglielli stated above

when I changed SIZEOF_LONG_INT to 8 in the file /usr/include/unixodbc_conf.h

It compiled successfully!

I got the same error that @marufmax got, just remember to install

# optional: for unixODBC development headers
sudo apt-get install unixodbc-dev

After that, it worked. !

thanks … I install this and try install SQLSRV again and it works …

Your header file defines SIZEOF_LONG_INT as 4. SIZEOF_LONG_INT is then used in sqltypes.h to typedef unsigned long as DWORD, but the sqlsrv source typedefs unsigned int as DWORD, and these conflict because unsigned long is 8 bytes on your system and unsigned int is 4 bytes. SIZEOF_LONG_INT should be 8. I suspect you installed unixODBC manually with certain configure flags - can you provide the commands you used to install unixODBC?

The PHP drivers used to require a specific set of configure options relating to type lengths when building unixODBC, but that is no longer the case and the packaged unixODBC from apt works. If you do not specifically need to manually compile unixODBC for some other application, it would be easiest to remove it from your system and reinstall using apt-get install unixodbc.