简体   繁体   English

如何在XAMPP Linux中启用odbc

[英]How to enable odbc in XAMPP linux

I am working on a php application in which for database connection I am using odbc. 我正在开发一个PHP应用程序,其中使用odbc进行数据库连接。
The code is working properly in windows but when I tried the same code in Linux I am facing 该代码在Windows中正常工作,但是当我在Linux中尝试相同的代码时,我正面临

Fatal Error Undefined Function odbc_connect() 致命错误未定义函数odbc_connect()

I think this error occurs because odbc is not enabled on XAMPP. 我认为会发生此错误,因为XAMPP上未启用odbc。

Please advoice me how to enable odbc in XAMPP under Linux. 请告诫我如何在Linux下的XAMPP中启用odbc。

Thanks in advance 提前致谢

Know this is an old one, but in case somebody else is looking... 知道这是一个古老的,但万一有人在找...

I had this same issue with my XAMPP setup. 我的XAMPP设置有相同的问题。 If you open your php.ini file, via the XAMPP Control Panel, do a search for this line: ;extension=php_pdo_odbc.dll 如果通过XAMPP控制面板打开php.ini文件,请搜索以下行: ;extension=php_pdo_odbc.dll

Beneath it, paste in the following: extension=php_odbc.dll and you should be good to go. 在其下面,粘贴以下内容: extension=php_odbc.dll ,您应该extension=php_odbc.dll顺利。

Interesting that the comments for that section state "Note that ODBC support is built in, so no dll is needed for it." 有趣的是,该部分的注释为“请注意,因为内置了ODBC支持,因此不需要dll。” As an aside, you might also need to restart Apache from the XAMPP Control Panel. 顺便说一句,您可能还需要从XAMPP控制面板重新启动Apache。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM