PHP Connection SQL Server 2008 not even up!
The operating system is win server R2, the database is SQL Server 2008,php Version 5.4.14,
Look in the phpinfo of the output
-------------------------------------------------
PDO supportenabled
PDO Driversmysql, SQLite, sqlsrv
However, if you want to access the database using Sqlsrv, the "HTTP error 500.0" Prompt always appears,
-------------------------------------------------
Module Fastcgimodule
Notify Executerequesthandler
Handler php54_via_fastcgi
Error code 0x00000000
This is a routine that accesses the opcode that is actually copied from Microsoft Driver for PHP for SQL Server:
/* Specify the server and connection string attributes. */
$serverName = "(local)";
$connectionInfo = Array ("Database" = "myDB1");
/* Connect using Windows authentication. */
$conn = Sqlsrv_connect ($serverName, $connectionInfo);
if ($conn = = = False)
{
echo "Unable to connect.
";
Die (Print_r (Sqlsrv_errors (), true));
}
Else
";
?>
Share to:
------Solution--------------------
Configure PHP.ini to open PHP's expansion to MSSQL.
------Solution--------------------
PDO Driversmysql, SQLite, Sqlsrv???
Only this one?
You write a single program
Var_dump (function_exists (' sqlsrv_connect '));
See what the output is.
------Solution--------------------
I use the PHP version is 5.2.6 has been in normal use.
------Solution--------------------
No kidding!
A single sentence
Var_dump (function_exists (' sqlsrv_connect '));
This could be an HTTP error 500.0-internal Server error
is at most bool (false)