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.

Debaddy
feita há 6 meses853 visualizações
Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas