Php – Connecting to SQL Server on Parallels Desktop with PHP

mac-osxPHPsql servervirtualization

well I recently bought a Mac and am using it as my primary computer.

Because I am required to work with MSSQL via PHP, I have installed Parallels Desktop and run Server 2008 R2 on it. I am using the same mixed mode authentication which I previously had on windows.

When I attempt to connect to the server with PHP using either a new test file or my old code, it just doesn't find the server.

I have tried running PHP on the XP install with parallels, and using the hostname as COMPUTERNAME\SQLEXPRESS, LOCALIP\SQLEXPRESS localhost localip etc, PHP never finds the server.

Also note that I can connect to the database server using Management Studio without problems, so SQL Server is running.

Please note that both PHP and MSSQL are running within the virtualised environment.

Any contribution is appreciated

Best Answer

For SQL Server Express, remote connections are not allowed by default. Have you enabled them?

See https://stackoverflow.com/questions/11278114/enable-remote-connections-for-sql-server-express-2012