简体   繁体   中英

PHP Startup: Unable to load dynamic library 'sqlsrv_7_ts_x64'

I am trying to install Apache, MySQL, and PHP on a Windows 2008 server (trial run, will move to 2012 when available).

  • Apache 2.4.39
  • PHP 7.2.18
  • MySQL 5.7.26

Actually have this portion working.

Need to add the capability to access a Microsoft SQL database. Have installed SQLSRV40.
extension_dir is extension_dir ="c:/wamp64/bin/php/php7.2.18/ext/".dlls are in extension_dir. php_pdo_sqlsrv_7_ts_x64.dll php_pdo_sqlsrv_7_nts_x64.dll php_sqlsrv_7_ts_x64.dll php_sqlsrv_7_nts_x64.dll

Added these statements to php.ini: ; Adding extensions for accessing SQL databases;extension=php_pdo_sqlsrv_7_ts_x64.dll;extension=php_pdo_sqlsrv_7_nts_x64.dll;extension=php_sqlsrv_7_ts_x64.dll;extension=php_sqlsrv_7_nts_x64.dll extension=sqlsrv_7_ts_x64

Restarting Apache with php.ini configured as above results in: [30-Oct-2019 19:11:23 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv_7_ts_x64' (tried: c:/wamp64/bin/php/php7.2.18/ext/sqlsrv_7_ts_x64 (The specified module could not be found.), c:/wamp64/bin/php/php7.2.18/ext/php_sqlsrv_7_ts_x64.dll (The specified procedure could not be found.)) in Unknown on line 0 [30-Oct-2019 19:11:24 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv_7_ts_x64' (tried: c:/wamp64/bin/php/php7.2.18/ext/sqlsrv_7_ts_x64 (The specified module could not be found.), c:/wamp64/bin/php/php7.2.18/ext/php_sqlsrv_7_ts_x64.Z06416233FE 5EC4C5933122E4AB248AF1Z (The specified procedure could not be found.)) in Unknown on line 0

Using the extensions with php at the beginning and.dll at the end results in: [30-Oct-2019 19:03:15 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_7_ts_x64.dll' (tried: c:/wamp64/bin/php/php7.2.18/ext/php_pdo_sqlsrv_7_ts_x64.dll (The specified procedure could not be found.), c:/wamp64/bin/php/php7.2.18/ext/php_php_pdo_sqlsrv_7_ts_x64.dll.dll (The specified module could not be found.)) in Unknown on line 0 [30-Oct-2019 19:03:15 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_7_nts_x64.dll' (tried: c:/wamp64/bin/php/php7.2.18/ext/php_pdo_sqlsrv_7_nts_x64.Z0 6416233FE5EC4C5933122E4AB248AF1Z (The specified module could not be found.), c:/wamp64/bin/php/php7.2.18/ext/php_php_pdo_sqlsrv_7_nts_x64.dll.dll (The specified module could not be found.)) in Unknown on line 0 [30-Oct-2019 19:03:15 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_sqlsrv_7_ts_x64.dll' (tried: c:/wamp64/bin/php/php7.2.18/ext/php_sqlsrv_7_ts_x64.dll (The specified procedure could not be found.), c:/wamp64/bin/php/php7.2.18/ext/php_php_sqlsrv_7_ts_x64.dll.dll (The specified module could not be found.)) in Unknown on line 0 [30-Oct-2019 19:03:15 UTC] PHP Warning: PHP Startup: Unable t o load dynamic library 'php_sqlsrv_7_nts_x64.dll' (tried: c:/wamp64/bin/php/php7.2.18/ext/php_sqlsrv_7_nts_x64.dll (The specified module could not be found.), c:/wamp64/bin/php/php7.2.18/ext/php_php_sqlsrv_7_nts_x64.dll.dll (The specified module could not be found.)) in Unknown on line 0

Filenames have been verified as correct. Apache user has been verified as having access to the ext folder and those files.

Using the tool that came with Wampserver to via active PHP extensions, all four show as active whether they are commented out or not. php_pdo_sqlsrv_7_ts_x64 php_pdo_sqlsrv_7_nts_x64 php_sqlsrv_7_ts_x64 php_sqlsrv_7_nts_x64

Any ideas?

Found out from additional searching that the sqlsrv_7 dlls don't work with PHP 7.2. Had to download a different set of drivers (Windows-7.2). Works. Having a different issue but that's for a new question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM