Using/Installing Microsoft SQL Server Driver in Amazon Linux 2023

0

Launched EC2 instance with Amazon Linux 2023 Created connection with Amazon RDS SQL Server Database. Database is up and running and can be connected through Azure Data Studio. On trying to run a PHP file to connect to the Database using all valid connection parameter, error is reported during execution of $pdo = new PDO($dsn, $username, $password); "Error:could not find driver" Tried to install the MS SQL driver using: sudo pecl install sqlsrv

However, compilation of conn.cpp fails as it cannot find sql.h libtool: compile: g++ -I. -I/var/tmp/sqlsrv -I/var/tmp/pear-build-rootLURU85/sqlsrv-5.11.1/include -I/var/tmp/pear-build-rootLURU85/sqlsrv-5.11.1/main -I/var/tmp/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -std=c++11 -DZEND_COMPILE_DL_EXT=1 -c /var/tmp/sqlsrv/conn.cpp -MMD -MF conn.dep -MT conn.lo -fPIC -DPIC -o .libs/conn.o In file included from /var/tmp/sqlsrv/shared/typedefs_for_linux.h:23, from /var/tmp/sqlsrv/shared/xplat_winnls.h:24, from /var/tmp/sqlsrv/shared/FormattedPrint.h:24, from /var/tmp/sqlsrv/shared/core_sqlsrv.h:41, from /var/tmp/sqlsrv/php_sqlsrv_int.h:25, from /var/tmp/sqlsrv/conn.cpp:24: /var/tmp/sqlsrv/shared/xplat.h:30:10: fatal error: sql.h: No such file or directory 30 | #include <sql.h> | ^~~~~~~

Searched for sql.h from / - no such file exists.

This is where I am stuck.

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠