[英]PHP connection “Failed to get DB handle: could not find driver”
I'm using the following code to try and connect: 我正在使用以下代码尝试连接:
try {
$hostname = "*****";
$port = 1443;
$dbname = "*******";
$username = "********";
$pw = "************";
$dbh = new PDO ("dblib:host=$hostname:$port;dbname=$dbname","$username","$pw");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "\n";
exit;
}
This is my Error: 这是我的错误:
Failed to get DB handle: could not find driver
And the DLL Files are already in the php/ext and modified in the php.ini DLL文件已经在php / ext中,并在php.ini中进行了修改
What else can I do? 我还可以做些什么?
There is following of possibility here, 这里有可能,
enable mssql in php.ini 在php.ini中启用mssql
;extension=php_mssql.dll
to extension=php_mssql.dll
到
extension=php_mssql.dll
try editing your setting at the php.ini mssql.secure_connection must be set to on . 尝试在php.ini上编辑设置, mssql.secure_connection必须设置为on 。 mssql_connect can use secured connection if php is configured ... go into the php.ini and verify the mssql.secure_connection parameter
如果配置了php,则mssql_connect可以使用安全连接...进入php.ini并验证mssql.secure_connection参数
[MSSQL]
mssql.secure_connection = On
3.Try this: [MSSQL]
mssql.secure_connection = On
3。尝试以下操作:
Uncomment the following in php.ini by removing the ";" 通过删除“;”在php.ini中取消注释以下内容:
;extension=php_pgsql.dll
I hope this will help you. 我希望这能帮到您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.