doy2255 2016-05-10 19:23
浏览 110

NetSuite ODBC驱动程序配置

Let me preface this by saying I don't have a lot of experience with LAMP environment. I get around but I have crashed the server a couple times poking around. That said...

I'm installing the NetSuite 64bit ODBC driver on an Ubuntu 14.04.4 box on AWS. I also have the Windows driver which I tried using a WAMP setup. On the WAMP setup on my desktop, I can get the connection to work and can query the NetSuite database. On the server, the ODBC driver is set up properly and I have been able to get it to work using isql using the odbcisql64 that is provided by NetSuite.

ISQL> connect "usr"*"pwd"@netsuite
SQL: connecting to database: netsuite...
Elapsed time 1336 ms.

This means that the DSN is set up properly. When I run the PHP code to access the database using the driver, I get this error:

 Fatal error: Call to undefined function odbc_connect() in /var/www/html/www.xxxxx.com/xxxx/GetNSData_1.php on line 5

My PHP code looks like this:

error_reporting(E_ALL);
ini_set('display_errors', '1');

$conn = odbc_connect("NetSuite", "usr", "pwd");
if (!$conn) { 
    die(' Could not connect: ' . odbc_error()); 
}
$query = odbc_prepare($conn, "Some Query");
$success = odbc_execute($query, array('Data'));
if($success)
    odbc_result_all($query);

So this means that there is a missing package on the LAMP server. I'm not sure exactly sure which ones to install. I've tried a whole bunch including unixODBC and FreeTDS. When I install these packages, I get a different error that says this:

Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/www.xxxxx.com/xxxxxx/GetNSData_1.php on line 6

After fixing the linkage in the odbcinst command to be sure that the driver is installed, then I get an error that tells me nothing. There's no error code or anything- not even an odbc_error() response:

Warning: odbc_connect(): SQL error: [unixODBC], SQL state in SQLConnect in /var/www/html/www.xxxxx.com/xxxxxx/GetNSData_1.php on line 5
Could not connect:

So What I suspect is happening is that some path is not getting to the driver anymore. I've tried things online like this: http://www.debugthat.com/connecting-to-netsuite-using-linux-and-odbc but I'm missing something. I know it has to do with the configuration but I'm not knowledgeable enough to see what I'm missing.

If anyone could give me some help on this I would be eternally grateful! Thanks!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题