简体   繁体   中英

Connecting IBM Graph and php

I am a beginner with IBM Graph db as well as IBM Bluemix. I need to make entry to the db using php.

Have tried making connection using this library https://github.com/PommeVerte/gremlin-php hosted in official tinkerpop but it doesnt work.

After debugging got to know that whenever it encounters

require_once('vendor/autoload.php'); 
use Brightzone\GremlinDriver\Connection;

$db = new Connection([
'host' => 'localhost',
'graph'=>'g',
'ssl' => [
            "ssl"=>[
                    "verify_peer"=>false,
                    "verify_peer_name"=>false,
            ]
        ]
]);

$db->open(); 

it stops execution. It does not show any error and its just an empty page.

Can somebody guide me in solving this issue?

Thanks

@Radhika, eventhough IBM Graph supports Tinkerpop 3, it doesn't give you direct access to the gremlin server as it's a multi-tenant hosted service. That being said, connecting to IBM Graph as easy as calling an HTTP API. You can use cURL for example to do that http://codular.com/curl-with-php . The full API doc is right here https://ibm-graph-docs.ng.bluemix.net/api.html .

There is example code, no php yet, right here https://ibm-graph-docs.ng.bluemix.net/examples.html#node.js . Hopefully, We will add php examples soon.

So head to bluemix.net, goto to the catalog and look for IBM Graph. Create an instance of IBM Graph and take note of the credentials.

{
  apiURL:""
  username:""
  password:""
}

Use those credentials to call the http API's

I hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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