Problems with mssql_connect() on IIS
Lately I’ve been reinstalling my Windows servers a couple of time due to some problems. I’m running both PHP (WordPress) and ASP.NET on my server. From my WordPress blog I sometimes connect to MS SQL to get some data and this time i could not get the MSSQL extension in PHP to work. I got this error all the time.
call to undefined function mssql_connect()
When you Google this you mostly get the tip that you should put the file ntwdblib.dll in the /ext folder. I have a vague memory that this helped me the last time i had this problem but this time that didn’t help. I also noticed that MSSQL was not loaded when i run phpinfo(). Finally I found this poston the IIS forum that recommended me to run the command.
php-cgi.exe -v
When I did this I got an error message telling me that “This program cannot start because msvcr71dll is missing from your computer”. I then downloaded this dll file, put it in my C:WindowsSysWOW64 (/system32 if you are on 32 bit). I also recycled my application on IIS and then everything worked. Hallelulja! I have no idea if it’s related but i used “Web platform installer” to install PHP.
Thank you so much, I was banging my head over this one and this solution fixed it!