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 ...


... 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


cat 40-pdo_sqlsrv.ini


... 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.

  • What does phpinfo(); say?
    – David
    Feb 26, 2019 at 17:18
  • 1
    Also be aware that Fedora 27 is past end of life. You should update to a currently supported Fedora release. Feb 26, 2019 at 17:21
  • phpinfo() provides enormous amount of data ... but it does not show the sqlsrv module loaded. Feb 26, 2019 at 18:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.