0

I have installed sqlsrv & pdo_sqlsrv per https://github.com/Microsoft/msphpsql/tree/PHP-7.0-Linux

I created a test program that works perfectly from the command line but not when viewed in a web page.

If I put ...

extension=/usr/lib64/php/modules/pdo_sqlsrv.so
extension=/usr/lib64/php/modules/sqlsrv.so

... in the php.ini, then I get this error when program is run from command line...

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_sqlsrv.so' - /usr/lib64/php/modules/pdo_sqlsrv.so: undefined symbol: php_pdo_register_driver in Unknown on line 0

if I put the following 2 files in /etc/php.d ...

cat 40-pdo_sqlsrv.ini

extension=/usr/lib64/php/modules/pdo_sqlsrv.so

cat 40-pdo_sqlsrv.ini

extension=/usr/lib64/php/modules/pdo_sqlsrv.so

... then the program works fine from the command line only.

Either way, if I run it from a web page I get this error...

PHP Fatal error:  Uncaught Error: Call to undefined function sqlsrv_connect() 

Also, sqlsrv shows as a loaded module when php -i is run from the command line but does not show as a loaded module when phpinfo(); is run from a web page.

I need help with the final step of getting sqlsrv to work from a web page.

Thanks in advance.

0 Answers0