赢7
我正在尝试用PHP5.6连接到我的Server。我正在使用XAMPP和Notepad++。我从离线获得PHP脚本:
<?php
$serverName = "mydatabasename";
//serverName\instanceName
// Since UID and PWD are not specified in the $connectionInfo array,
// The connection will be attempted using Windows Authentication.
$connectionInfo = array( "Database"=>"dbName");
sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>我将脚本保存为.php。每当我在XAMPP上打开Apache时,我就会得到错误。
"The program can't start because php5.dll is missing from your computer. Try
reinstalling the program to fix this problem." 我搜索了php5.dll并下载了它,并把它放在我的php/ext中。我还在某个地方读到了我需要phpdbg的内容,但在5.6之后,我看到phpdbg包含在PHP中。我下载了PHP SQLSRV32,因为要使用sqlsrv_*函数,就需要一个sqlsrv_*驱动程序。
当我运行测试文件时,除了我的连接脚本之外,它们都能工作。
那么,1.为什么我要得到"php5.dll“错误? 2.连接脚本的建议?
发布于 2017-06-13 15:44:10
您能使用phpinfo()来查看PHP认为应该从哪里调用扩展吗?您从Googlephp5.dll下载的文件是线程安全版本还是非线程安全版本?请与他们两人核对。
尝试重命名或删除php.ini文件吗?
https://stackoverflow.com/questions/44525826
复制相似问题