php连接sql server 2008连不上呀!
操作系统是win server 2008 r2,数据库是sql server 2008,PHP Version 5.4.14,
在输出的phpinfo当中看
-------------------------------------------------
PDO supportenabled
PDO driversmysql, sqlite, sqlsrv
但是想使用sqlsrv访问数据库就是不行,始终出现“HTTP 错误 500.0”提示,
-------------------------------------------------
模块FastCgiModule
通知ExecuteRequestHandler
处理程序PHP54_via_FastCGI
错误代码0x00000000
这是访问的操作码,其实是从microsoft driver for PHP for sql server上拷贝的例程:
<?php
/* 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.</br>";
die( print_r( sqlsrv_errors(), true));
}
else
echo "great! </br>";
?>
<?php看看输出什么
var_dump(function_exists('sqlsrv_connect'));