开发者

can't get odbc working in apache

I installed unixODBC by using apt-get install, and now when I try to use odbc_connect() is still开发者_JAVA技巧 get this error.

PHP Fatal error:  Call to undefined function odbc_connect()

what do i need to do to configure it to work with php? I have been looking online but I can't really figure it out.


I think you need to install php5-odbc also. unixODBC provides the driver manager, but you need the PHP code that calls it.


Had the same issue on CentOS 6.3 with PHP 5.3.16. But the fix was to use yum to install php-odbc.

yum install php-odbc


Did you add it to your LD_LIBRARY_PATH? Check the documentation for your server, it may require third-party libraries to be in a specific sub-directory, or have some other mechanism for finding them. If so, you should be able to create a symbolic link to the library. That way, if it gets updated, your server will automatically use it.


We had this problem also. We installed php5-odbc, and still had the problem. Turns out we needed to reboot Linux for php to see the function. Recycling Apache was not enough!


Make sure to enable odbc extension for your Apache by a2enmod odbc.

Then check if exists by: apache2ctl -M.

If you don't have this extension, install via apt-get install php-odbc (use yum in case of CentOS).

See also: Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜