Call to undefined function odbc_connect() php 7

PHP 7.2.7, add extension=php_odbc.dll in php.ini file while either using database as MS Access or Sql Server C:\xxxxxx\php\php.ini

*no semicolon before to extension=php_odbc.dll


There is written in doc: ODBC support doesn't need any extension dll. It is true in PHP 5.x, I had to remove "extension=php_odbc.dll" from ini file.
But in PHP 7 I had to put it back.

I found the file "ext/php_odbc.dll" in the new PHP 7 directory again. It works for me :).


The DOC page does list PHP 7, so just install php-odbc and you should be good to go. Currently using it myself on RedHat EL7 with Remi php7.


I ran into the same problem. However according to the link you provided PHP7 is in fact supported. So I'm not sure why you have so many comments telling you to go re-write your code.

This is what ultimately fixed the issue for me:

sudo apt-get install php-odbc

Followed by restarting Apache.

Tags:

Php