I downloaded the dll extension from the Microsoft site http://sqlsrvphp.codeplex.com/, connected in php.ini

extension = php_pdo_sqlsrv_54_ts.dll extension = php_sqlsrv_54_ts.dll extension = php_pdo_sqlsrv_54_nts.dll extension = php_sqlsrv_54_nts.dll

Reboot the server, then when trying to connect to the server throws an error

Call to undefined function mssql_connect ()

What to do? Why the extension is not connected? Version php 5.5.1, version apache 2.4.6, version of server SQL Express 2012

Thank you in advance

  • On php 5.4.17 also does not connect, I have thread safety on. I removed the values, I left only ts extension = php_sqlsrv_54_ts.dll the same error (((( - rusbaron
  • sqlsrv should appear after connecting the dll but it does not appear .. the strange thing is that mssql dll was not originally in php, although in php.ini there is a whole section dedicated to mssql parameters .. - rusbaron 1313
  • @rusbaron, read the answer and documentation - xEdelweiss 1:38 pm
  • Fatal error: Call to undefined function sqlsrv_connect () in P: \ Server \ www \ index.php on line 9 yes, I got to there)) but no sense ... dll does not connect to php, there is no message in phpinfo () about the connection ... I do not understand why - rusbaron
  • means either you are connecting the wrong library, or the wrong php.ini - xEdelweiss

1 answer 1

Connect all at once?

These files are for PHP 5.4 , as hinted at 54 in the file name and " This release includes support for PHP 5.4.0. " On the download page.

To determine whether to include a ts or nts file, look in phpinfo() for the Thread Safety parameter. If Enabled , then ts , otherwise nts .

And restart the server.

Also in phpinfo() look for sqlsrv after connecting.

UPD:

From Mssql Introduction on php.net : " This extension is not available anymore on Windows with PHP 5.3 or later. "

Further read Accessing SQL Server Databases from PHP on MS TechNet , where you can learn that the sqlsrv_connect () function is used to connect

Or connect the driver to the PDO and use it. Maybe there everything remains as before.