How to configure the sqlsrv driver in windows for php

Mohammed Hussein 0 Reputation points
2023-03-03T16:00:53.0766667+00:00

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.
14,356 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,632 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,503 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,561 Reputation points
    2023-03-06T08:53:06.0666667+00:00

    Hi @Mohammed Hussein,

    Please refer to this link:

    https://learn.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-on-iis/install-the-sql-server-driver-for-php

    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,

    Seeya


    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.