Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

php - Fatal error: Uncaught PDOException: SQLSTATE[HYT00]: [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired

I have a question about this error because I really don't know where to look anymore.
The error says that the problem is on the line with the PDO. I also already made an inbound rule in the firewall so that the connection goes through the 1433 TCP port.
I work on a MacBook with Parallels Desktop with windows 10, maybe the problem is there?
I hope this is enough info to maybe see a problem.

$hostname = 'host.docker.internal';
$dbname = 'FLETNIX';
$username = 'applicatie';
$pw = 'removed-for-safety';

$dbh = new PDO("sqlsrv:Server=$hostname;Database=$dbname;ConnectionPooling=0", $username, $pw);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...