我已经设置了apache点燃,从Java应用程序加载数据到点燃并且可以使用rest apis进行查询。我需要从PHP查询它
我正在尝试使用pdo_odbc从PHP连接到Apache Ignite。我有,
i)已安装的ODBC驱动程序管理器 - http://www.unixodbc.org/
ii)内置ODBC驱动程序http://apacheignite.gridgain.org/docs/odbc-driver#section-building-on-linux
iii)安装了Ignite ODBC驱动程序http://apacheignite.gridgain.org/docs/odbc-driver#section-installing-on-linux,
iv)使用
配置dsn,http://apacheignite.gridgain.org/v1.8/docs/connecting-string#configuring-dsnodbcinst -j
unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/me/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
cat /etc/odbcinst.ini
[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1
cat /etc/odbc.ini
[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1
cat /home/me/.odbc.ini
[Apache Ignite]
Description=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1
v)安装了pdo_odbc,
sudo apt install php5.6-odbc
在phpinfo中显示。
vi)使用
启用OdbcConfigurationIgnite ignite = Ignition.start("examples/config/example-ignite.xml");
IgniteConfiguration iCfg = ignite.configuration();
OdbcConfiguration odbcCfg = new OdbcConfiguration();
iCfg.setOdbcConfiguration(odbcCfg);
ⅶ)
$ignite = $dbh = new \PDO('odbc:Apache Ignite');
$ignite->prepare('select * from Person');
我仍然得到这个例外。
[PDOException]
SQLSTATE[01000] SQLConnect: 0 [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libignite-odbc.so' : file not found
更新:LD_LIBRARY_PATH已经有/ usr / local / lib ls / usr / local / lib | grep libignite-binary-1.8.0.16166.so.0
libignite-binary-1.8.0.16166.so.0
libignite-binary-1.8.0.16166.so.0.0.0
ldd /usr/local/lib/libignite-odbc.so
linux-vdso.so.1 => (0x00007ffe68521000) libignite-binary-1.8.0.16166.so.0 =>找不到
答案 0 :(得分:0)
您是否尝试过ldd /usr/local/lib/libignite-odbc.so
?似乎有一些未解决的依赖项。也许您需要将它们添加到LD_LIBRARY_PATH
。