Search code examples
phpsql-serveriiswindows-server-2003php-extension

sqlsrv hangs in windows with php 5.4


I know this was asked alot of times but all the answers are outdated.

As of PHP 5.3, as we all know mssql is not supported, so went on installing Microsoft's sqlsrv driver for this, as it seems to be the only option out there (I'm open to suggestions!).

Now I'm using PHP 5.4 on a Windows server 2003, SQL Server 2005 with IIS as webserver.

I've followed about a million guides and i've installed everything accordingly, but the driver just wont load, sqlsrv won't show on phpinfo() or it hangs.

This is what i've done in php.ini :

 extension=php_sqlsrv_54_nts.dll

And the extension_dir is set to C:\PHP\ext, though phpinfo() shows its loading a php.ini file from progrem files, so i'm editing 2 php.ini files every time as i'm not sure which one is active. For the same reason i've put the dll files in both locations.

There is no information for this problem! all the solutions are for people who have used the wrong versions, etc.

I've tried applying every single dll and all with the same result, including Threaded and non-threaded.

What can i do?


Solution

  • I see you're using Windows Server 2003. You need to use Version 2.0 of the PHP for SQL Server drivers with Windows Server 2003. You can't use the newest version 3.0 drivers.

    However you need version 3.0 of the "PHP for SQL Server drivers" to work with PHP 5.4+.

    Basically you need to update your OS to Windows Server 2008 in order to use PHP 5.4+ (if you want SQL Server driver support).

    http://msdn.microsoft.com/en-us/library/cc296170.aspx

    I know this is an old question, but it was one of the first results when I was looking for information earlier today.