msphpsql: PHP throws "undefined symbol: SQLGetInstalledDrivers"

PHP Driver version or file name

sqlsrv-5.3.0
pdo_sqlsrv-5.3.0

Client operating system

CentOS Linux release 7.5.1804 (Core)

PHP version

PHP 7.1.20 (cli) (built: Jul 19 2018 10:10:15) ( NTS )

Microsoft ODBC Driver version

Name        : msodbcsql17
Arch        : x86_64
Version     : 17.2.0.1
Release     : 1

Problem description

After following the RedHat 7 guide (https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-2017#installing-the-drivers-on-red-hat-7) php throws the following warnings:

# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/sqlsrv.so' - /usr/lib64/php/modules/sqlsrv.so: undefined symbol: SQLGetInstalledDrivers in Unknown on line 0
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: SQLGetInstalledDrivers in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ixed.5.4.lin' - /usr/lib64/php/modules/ixed.5.4.lin: undefined symbol: _zend_hash_index_update_or_next_insert in Unknown on line 0
PHP 7.1.20 (cli) (built: Jul 19 2018 10:10:15) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

Trying to execute a PHP script using the drivers results in:

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

Repro code or steps to reproduce

I’m not sure how to reproduce this issue as I’ve setup the driver successfully on two Debian 9 systems. Please let me know if you require any additional information.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

The setup went flawlessly on the fresh VMs. I think we can close this issue.

Thank you again for your help. It’s greatly appreciated.