How to configure the sqlsrv driver in windows for php

Mohammed Hussein 0 Reputation points

Warning: PHP Startup: Unable to load dynamic library 'sqlsrv_74_ts_x64' (tried: C:\php\ext\sqlsrv_74_ts_x64 (The specified module could not be found), C:\php\ext\php_sqlsrv_74_ts_x64.dll (The specified module could not be found)) in Unknown on line 0

I have done all proper configurations like:
Downloading the php sql drivers from the official microsoft website
extracting the version i need to C:\php\ext\ folder eg php_pdo_sqlsrv_74_ts_x64.dll
added the extension=php_pdo_sqlsrv_74_ts_x64.dll

My php version is 8.2.3

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,009 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,242 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
6,032 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,301 Reputation points

    Hi @Mohammed Hussein,

    Please refer to this link:

    I'm not familiar with PHP. So I can only answer your question from the SQL Server perspective.

    Check that the required dependencies are installed. The sqlsrv driver has several dependencies that need to be installed on your system, including the Microsoft ODBC Driver for SQL Server, the Microsoft Command Line Utilities 15 for SQL Server, and the Visual C++ Redistributable for Visual Studio 2019.

    Best regards,


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments