php连接sql server 2008连不上呀!
操作系统是win server 2008 r2,数据库是sql server 2008,PHP Version 5.4.14,
在输出的phpinfo当中看
-------------------------------------------------
PDO support enabled
PDO drivers mysql, sqlite, sqlsrv
但是想使用sqlsrv访问数据库就是不行,始终出现“HTTP 错误 500.0”提示,
-------------------------------------------------
模块 FastCgiModule
通知 ExecuteRequestHandler
处理程序 PHP54_via_FastCGI
错误代码 0x00000000
这是访问的操作码,其实是从microsoft driver for PHP for sql server上拷贝的例程:
<br /><?php<br />/* Specify the server and connection string attributes. */<br />$serverName = "(local)";<br />$connectionInfo = array( "Database"=>"myDB1");<br /><br />/* Connect using Windows Authentication. */<br />$conn = sqlsrv_connect( $serverName, $connectionInfo);<br />if( $conn === false )<br />{<br /> echo "Unable to connect.</br>";<br /> die( print_r( sqlsrv_errors(), true));<br />}<br />else<br /> echo "great! </br>";<br />?><br />