We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

View Complete Thread
  • Re: Sql Connection fails until App Pool recycle

    Jan 05, 2020 02:33 PM|JuanMdP|LINK

    A bit more of info upon further debugging of the errors returned by sqlsrv: 

    [0] => IM004
    [SQLSTATE] => IM004
    [1] => 0
    [code] => 0
    [2] => [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
    [message] => [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

    And on just one occasion I also got:

    [0] => 08001
    [SQLSTATE] => 08001
    [1] => 0
    [code] => 0
    [2] => [Microsoft][ODBC Driver 11 for SQL Server]Unable to complete login process due to delay in opening server connection
    [message] => [Microsoft][ODBC Driver 11 for SQL Server]Unable to complete login process due to delay in opening server connection

    From what I've found around the web, reinstalling / repairing the driver fixes it for those who experience this permanently, however I did and it still triggers here and there. Furthermore, this goes away the moment I recycle the app pool. Anyone else ever experienced this with PHP + Sqlsrv extension~?