I'm a complete noob at windows servers and IIS so please be patient with me.

I originally set up a website using php/mysql. I have the website running PHP with FastCGI through IIS already, but the SQL Server part is tripping me up. I'm shocked that there are no instructions about this that I can find anywhere.

I installed a bunch of SQL Server options through the Web Platform Installer (WPI). I can't connect using sqlcmd or the Microsoft SQL Server Management Studio. I get the same error for both ("A network related or instance-specific error has occurred...") I know I'm missing a vital step to start up the server and connect to it, but I can't find what I need to do anywhere. SQL Server (SQLEXPRESS) is displaying as running in my services list. In the SQL Server Configuration manager, SQL Server (SQLEXPRESS) is shown as running in the SQL Server Services list. SQL Server Browser and SQL Server Agent are listed, but stopped, and the option to start them is grayed out.

I need to be able to create my DB on this machine through something and connect to the server through php with the sqlsrv driver. The sqlsrv_* functions work, but I can't connect to localhost with sqlsrv_connect() either. I'm sure I'm just missing some important step to get the server actually running.

I'd love to use LAMP, but a lot of the other application software relies on SQL Server and windows.


You sayed something about php/mysql, be aware that SQL Server (Express) is not MySql.

First of all, I guess you want to at lest get a connection using Management Studio so you at least can 'see' a database? You first need to configure the SQL Server Client. Try this:

  • Hold down the windows key and press "R" (or click the start button and use the search box).
  • type "cliconfg" (without the quotes) and hit enter
  • Enable Named pipes or TCP/IP and check shared memory

Now you have to do the same on the server: In the start menu you should have a "SQL Server 2008 R2" entyr with "Configuration tools" under it. From there click on "SQL Server Configuration Manager". If you can't find the "SQL Server Configuration Manager" in your start menu (it might not be installed for "all users") try this:

From there you should be able to enable the server-side protocols.

After this, you should be able to connect to the server using SQL Server Management Studio. Now you can run your SQL installation scripts (you might need to do some tweaking if the original ones were for MySql).

This is not a full answer since you're not done yet. You'll have to tweak the PHP site to use the correct client and set the correct connection-string(s). Hope that helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.