We are having a problem with PHP/MSSQL 2008/IIS.
Our webserver is as such.
Windows 2003
Running IIS 6 / PHP 5
Our Database server is as such
Windows 2003
Running MSSQL 2008
We are using SQL authentication. From the webserver I can connect using SQL2008's SQL Server Management studio without issue. I cannot connect with PHP however. My php connection code is as follows
<?php
$con = mysql_connect("xxx.xxx.xxx.xxx","username","password");
if (!$con)
{die('Could not connect: ' . mysql_error());}
?>
This outputs the following message to the webpage when trying to view the page
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in C:\Standards\inc\database\test.php on line 2
Fatal error: Maximum execution time of 90 seconds exceeded in C:\Standards\inc\database\test.php on line 2
Again.. I can connect fine outside of PHP but using the above connection code it will not connect.
Any ideas?