0
votes

I've installed ignite 2.7 , nginx, php7.0-fpm.

I also installed unixodbc, unixodbc-dev, libtool, automake, libssl-dev, and m4.

The odbc installation looked at the official homepage and followed up, but there was a problem.

cat odbc.ini // odbcinst.ini // .odbc.ini (all same)

[Apache Ignite]
Description=Apache Ignite
DSN=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
Setup=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1

tail /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export LD_LIBRARY_PATH=/usr/local/lib/

ldd /usr/local/lib/libignite-odbc.so

linux-vdso.so.1 =>  (0x00007ffef07c0000)

libignite-binary-2.7.0.33575.so.0 => /usr/local/lib/libignite-binary-2.7.0.33575.so.0 (0x00007fd8b8d4d000)

libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007fd8b8b3b000)

libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd8b87b9000)

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8b83ef000)

libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd8b81d9000)

libignite-common-2.7.0.33575.so.0 => /usr/local/lib/libignite-common-2.7.0.33575.so.0 (0x00007fd8b7fc2000)

libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fd8b7db8000)

libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8b7b9b000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd8b7892000)

/lib64/ld-linux-x86-64.so.2 (0x00007fd8b9227000)

libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8b768e000)

ex.php

<?php

try {
    // Connecting to Ignite using pre-configured DSN.
    $dbh = new \PDO('odbc:Driver=Apache Ignite;ADDRESS=127.0.0.1:10800;Cache    =default');

    // Changing PDO error mode.
    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    // Preparing query.
    $dbs = $dbh->prepare('INSERT INTO city (id, name) VALUES (?, ?)');

    // Declaring parameters.
    $key = 777;
    $firstName = "James";

    // Binding parameters.
    $dbs->bindParam(1, $key);
    $dbs->bindParam(2, $firstName);

    // Executing the query.
    $dbs->execute();

} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "\n";
    die();
}

?>

localhost/ex.php

Error!: SQLSTATE[01000] SQLDriverConnect: 0 [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libignite-odbc.so' : file not found

I do not know what to try. Thank you for your help.

1

1 Answers

0
votes

Try to use PHP Thin Client instead which requires fewer configuration efforts: https://apacheignite.readme.io/docs/php-thin-client

If PHP PDO is still required then Ignite ODBC experts should step in.