PHP8.2 Ubuntu 20.04安装 php sqlsrv 扩展出错
/tmp/pear/temp/sqlsrv/shared/xplat.h:30:10: fatal error: sql.h: No such file or directory
sudo pecl install sqlsrv
libtool: compile: g++ -I. -I/tmp/pear/temp/sqlsrv -I/tmp/pear/temp/pear-build-root9TAy6h/sqlsrv-5.11.0/include -I/tmp/pear/temp/pear-build-root9TAy6h/sqlsrv-5.11.0/main -I/tmp/pear/temp/sqlsrv -I/usr/include/php/20220829 -I/usr/include/php/20220829/main -I/usr/include/php/20220829/TSRM -I/usr/include/php/20220829/Zend -I/usr/include/php/20220829/ext -I/usr/include/php/20220829/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -std=c++11 -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/sqlsrv/conn.cpp -MMD -MF conn.dep -MT conn.lo -fPIC -DPIC -o .libs/conn.o
In file included 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_int.h:25,
from /tmp/pear/temp/sqlsrv/conn.cpp:24:
/tmp/pear/temp/sqlsrv/shared/xplat.h:30:10: fatal error: sql.h: No such file or directory
30 | #include <sql.h>
| ^~~~~~~
compilation terminated.
make: *** [Makefile:210: conn.lo] Error 1
ERROR: `make' failed
# 解决办法也很简单 安装依赖的库,然后就没有了。
apt-get install unixodbc-dev