Installing MS Sql 2008 with PHP v5.5.3


      I need to install MS Sql 2008 on my Windows 7 Professional. I have installed PHP v5.5.3 and IIS Express 8. The php folder is located in the IIS 8 Express folder. I checked the PHP.ini file and the only reference I see to MS Sql (I think that is what it is referencing) is under the Dynamic Extension - extension = msql.dll which I uncommented. I haven't installed MS Sql 2008 yet.
I have been using MySQL which I will still need to do on occasions.
What must I do for in order to use MS Sql Sever 2008 with PHP v5.5.3?
Please keep simple for I can be dumber than a box of rocks...
I have attached a printout of phpinfo. When I view it, I see nothing about mssql.
Thank you so much...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
I can't make it that simple.  You need the Microsoft SQL Driver for PHP 5.5 but you also need the SQL Native Client for SQL Server 2008.  If you are on the same machine as the SQL Server, the SQL Native Client will be installed with the server.  When you install SQL Server 2008, you also need SQL Server Management Studio so you can create databases and do admin work.  No matter what you do, Microsoft SQL Server is never going to be as easy as MySQL.  It just isn't.

SQL PHP Driver -
SQL Native Client -
SQL Server Management Studio -

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
About ten years ago, I built a product using PHP 5 and SQL Server and if I could provide some advice to myself in the past, it would be to avoid using the integrated mssql extension, and use some generic driver (PDO or ODBC). The mssql extension didn't upgrade consistently with PHP versions, and caused us to be unable to upgrade PHP regularly to handle security patches and such.

Using a generic approach like ODBC means that all the connectivity goes through a generic driver that has nothing to do with PHP, so you can update PHP as often as you need to without worrying about SQL Server driver compatibility issues (and without having to copy certain DLLs into the PHP directory). It also means you can easily switch over to a different type of database if you ever need to (SQL Server proved to be overkill in the long run, and I ended up porting the application to MySQL, which worked even better in several ways, and had equal performance, and was just as easy to admin with HeidiSQL). It also opens up the door to the application sitting on a non-Windows platform if you ever want to go down that route (e.g. a Linux web server connecting to a Windows database server).

There is also some funky behavior with some of the mssql_ functions, particularly when it comes to error output (we had to build some wrapper functions to handle the output properly).

Now, all that said, if you still want to go with the mssql extension, the main obstacle was ensuring that the ntwdblib.dll file resided in the PHP folder. That DLL file should come from the SQL Server install (or at least the tools install - if you're installing SQL Server Management Studio / Enterprise Manager on a client machine). If you have trouble finding it, try using Everything from void tools to search your hard drive for it (and if you aren't using Everything already, it's a fantastic tool).

The mssql extension relies on this library to function (or at least it used to). If adding that file into the PHP folder and restarting Apache/PHP still results in an error during startup, you can use Microsoft's Process Monitor (procmon) to look at the filesystem activity and see if it finding the file and if it's looking for anything else.
I'd also suggest looking closely at whether you really need SQL Server for your app. Honestly, SQL Server is a behemoth that comes with a TON of additional functionality that many people don't even end up using.

Many times, I've been brought in to review a project and it turns out that:
1. The client has a full-blown SQL Server 2008 Standard instance installed.
2. They're using the most basic CRUD functions (not even stored procedures).
3. Their databases are relatively tiny (under 1 gig almost every single time).
4. They don't use any of the other features that come with SQL Server.
5. They don't have a valid license for SQL Server - they're using an MSDN copy in a production environment, for example.

In virtually every case, it made a lot more sense to simply install MySQL and use HeidiSQL in place of Enterprise Manager/Management Studio, and port the application using InnoDB for the storage engine (there are even pre-made tools for doing this conversion). The app received the same performance, with far less overhead, with the ability to grow into newer features (stored procs, for example), and they eliminated the licensing problem.

Plus, using MySQL made it far easier to set up additional servers for load balancing and clustering later on, because MySQL is under 200 megs to download, and installs in a matter of minutes. If you've ever tried to fix a bad / incomplete / corrupted SQL Server install, it's a journey into a world of nightmares that has no consistent documentation nor any uninstall tools that handle those scenarios (plus, the ISO for it tends to be around 4 gigs).

No matter what, don't go into a production environment with an invalid license for SQL Server. It's not worth the risk, so if you're going to use SQL Server, ensure that you have a correct, valid license for it BEFORE you get too far down the road.
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Dave BaldwinFixer of ProblemsCommented:
The 'mssql extension' is unavailable on Windows as of PHP 5.3, you must use the Microsoft PHP SQL driver if you are on Windows.  The 'mssql extension' is available on Linux last time I checked but it can not do everything.  There is a Microsoft SQL Driver for Redhat RHEL Linux.
OverthereAuthor Commented:
I appreciate the information from both of you. You both provided good information.
 I had research the issue prior to posting and that's when I became confused. At PHP website, it sounded as if I only needed a driver, uncomment extension and viola, But when I searched for the driver I did not find it in my PHP installation. And then,  I read in another section of PHP where it sounded as if I needed only the driver or the odbc or the native client but only one or other and not both! Then it seemed I did needed both.
These were some of the articles I had read:
David,  you did make it simple. I had bookmarked the same pages. But I feel more at ease reading your post. I know it isn't going to be easy and I will probably be posting in another day or two and hollering for help. Personally, I would like to see them migrate to MySQL but I know it will not happen.
And yep, MS Sql is never easy and never will be. MySQL is so nice...sigh.

gr8gonzo,  I appreciate your posting  and concerns too. . Rest assured, their licenses, all of them are valid.  You make some very good points about MS Sql and MySQL. I certainly appreciate your input. Their database is very complex, very large and contains many stored procedures etc.

I am going to split the points, If this is not suitable to either of you, please let me know.
Thank you both again and I will as I have stated earlier, probably be posting real soon hollering for help....:}
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  The details for the 'sqlsrv' driver are in the help files and here on the site:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.