Phil Cross
Phil Cross

Reputation: 9302

PHP loading extensions error

I'm trying to get PHP to load some extensions (sqlsrv driver for PHP PDO). I'm using a wamp server, With PHP 5.4, Apache 2.4.4.

In my PHP.ini file, i've entered the following line:

extension_dir = C:\wamp\bin\php\php5.4.16\ext
...
extension=php_pdo_sqlsrv_54.nts.dll

However in the apache error log, whenever I restart the apache service, I get the error message:

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.4.16/ext/php_pdo_sqlsrv_54_nts.dll' - The specified module could not be found.\r\n in Unknown on line 0

Now, I know for a fact, this error is incorrect. If I copy the file location directly from the error log, (C:\wamp\bin\php\php5.4.16\ext\php_pdo_sqlsrv_54_nts.dll) and paste it into windows explorer, it finds the file fine.

I've added the ext directory to windows PATH environment variable, still no success.

Any ideas what to try next? Thanks

Upvotes: 1

Views: 3979

Answers (1)

RiggsFolly
RiggsFolly

Reputation: 94662

Your problem is that you are trying to run a NTS 'Not Thread Safe' dll with a PHP that is 'Thread Safe', so initially try downloading the Thread Safe version of the sqlsrv DLL.

BIG NOTE and possibly your next problems solution:

As far as I know the sqlserver database interface dlls are only available as 32bit. So if you have installed the 64bit WAMPServer you will have to uninstall and install the 32bit WAMPServer.

Upvotes: 1

Related Questions