Julian
Julian

Reputation: 3859

PHP Startup: Unable to load dynamic library 'C:\\xampp\\php\\ext\\php_sqlsrv_7_nts.dll'

I want to connect an SQL Server on my local computer via XAMPP. For that, I am using the following specs:

I already installed the drivers from here and here. I also linked the Non thread safe driver php_sqlsrv_7_nts_x86.dll in the x86 (32-Bit) version. When I now start the apache server via the XAMPP Control Panel, it gives me an error in the error_log from apache.

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_sqlsrv_7_nts.dll' - Das angegebene Modul wurde nicht gefunden.\r\n in Unknown on line 0

This is a german error message and means that the module was not found.

This is my php.ini file, which will be loaded:

extension_dir="C:\xampp\php\ext"

...

extension=php_pdo_sqlsrv_7_nts.dll
extension=php_sqlsrv_7_nts.dll

extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

So the dll file is located under the default ext folder. What is going wrong?

I think there must be a problem, that apache didn't find the dll file. But in the explorer, the dll file has the same name as I write in the php.ini.

Upvotes: 2

Views: 9674

Answers (1)

Álvaro González
Álvaro González

Reputation: 146350

If you get a PHP startup error when you start Apache that means you are running PHP as Apache module. In such case, you should be using the thread-safe version of PHP, as explained in the Windows download page:

With Apache you have to use the Thread Safe (TS) versions of PHP.

TS refers to multithread capable builds. NTS refers to single thread only builds. Use case for TS binaries involves interaction with a multithreaded SAPI and PHP loaded as a module into a web server. For NTS binaries the widespread use case is interaction with a web server through the FastCGI protocol, utilizing no multithreading (but also for example CLI).

Upvotes: 6

Related Questions