1
votes

I keep getting this error when I run my code:

Call to undefined function sqlsrv_connect().

I am using XAMPP, PHP 7.0, and SQL server. All the answers I found on how to fix this involves downloading the drivers.

I have installed in XAMPP/ PHP/ EXT folder:

  • php_pdo_sqlsrv_54_ts.dll
  • as well as 55 and 56
  • php_sqlsrv_54_ts.dll
  • as well as 55 and 56

and also the same for all of them with .nts instead of .ts. I also have in my php.ini folder thats located in my XAMPP/ PHP folder, the extensions to all these files. These are all the drivers I have tried and that haven't worked for me so far.

Any ideas on why this isn't working for me? Is it because the drivers are overlapping and causing a problem, or do I have the wrong ones downloaded?

1
I can't find any documentation that shows it's supported with php7. this page says they "are PHP 5 extensions" - Jeff Puckett

1 Answers

0
votes

It can't work because you're trying to use sqlsrv driver for PHP 5. Driver for PHP7 is in early technical preview stage and you can find it here https://github.com/Azure/msphpsql/tree/PHP-7.0. Look at install section in readme and don't forget install Microsoft ODBC driver for SQL server.