« Previous Next »

Not Answered Thread: [HELP] php_sqlsrv.dll autoload failed on IIS7 + Win7RC + MSSQL 2008 EXPRESS

Last post 09-20-2009 2:00 PM by RaulAngel. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 05-27-2009, 7:09 AM

    • ilovephp
    • Not Ranked
    • Joined on 05-27-2009, 10:32 AM
    • Posts 1

    [HELP] php_sqlsrv.dll autoload failed on IIS7 + Win7RC + MSSQL 2008 EXPRESS

    I got problem about IIS auto-load php_sqlsrv.dll, please help.

    Environment:
    Windows 7 Release Candidate
    Microsoft Web Platform Installer 2.0 Beta
    php.ini: added extension=php_sqlsrv.dll.

    script:
    <?php
    $serverName = "xxx\SQLEXPRESS";
    $connectionOptions = array(....);
    $conn = sqlsrv_connect($serverName, $connectionOptions);
    if ($conn === false) {
        echo "Unable to connect.";
    }
    else {
        echo "connected.";
        sqlsrv_close($conn);
    }
    ?> 

    When I ran the script, I got the error message:
    PHP Fatal error: Call to undefined function sqlsrv_connect() in C:\inetpub\wwwroot\dbtest.php on line 4.
    I placed dl('php_sqlsrv.dll'); at line 2 and ran the script again, "connected" message was printed, so I can sure that php_sqlsrv.dll not loaded after IIS started.

    Is there anyone can help me to let php_sqlsrv.dll autoload when IIS started.

  • 05-29-2009, 9:07 PM In reply to

    Re: [HELP] php_sqlsrv.dll autoload failed on IIS7 + Win7RC + MSSQL 2008 EXPRESS

    I assume you are using the non-thread safe version of PHP if you are using php_sqlsrv.dll? Check that php_sqlsrv.dll is being loaded using the phpinfo function. My guess would be that PHP is not loading your php.ini file.
    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 08-27-2009, 10:40 AM In reply to

    • cnavarroh
    • Not Ranked
    • Joined on 07-10-2009, 5:04 AM
    • Chile
    • Posts 2

    Re: [HELP] php_sqlsrv.dll autoload failed on IIS7 + Win7RC + MSSQL 2008 EXPRESS

    Hey, I have the same problem, and in the "php.log" file that I've configured to get error messages I get this:

    PHP Warning:  PHP Startup: sqlsrv: Unable to initialize module
    Module compiled with module API=20060613
    PHP    compiled with module API=20090626
    These options need to match
     in Unknown on line 0

    I'm with Windows XP + IIS v5.1 + PHP v5.3.0 and the mssql driver from this page:

    http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx

    Thanks for the help

    Al.

  • 09-20-2009, 2:00 PM In reply to

    Re: [HELP] php_sqlsrv.dll autoload failed on IIS7 + Win7RC + MSSQL 2008 EXPRESS

     that mean than PHP version doesn't correspond to sqlsrv version. Try sql server driver PHP 1.1 version

Page 1 of 1 (4 items)
Microsoft Communities