我在aws上安装了neo4j并且运行正常。我已经将tcp 7474设置为我的ip并且ssh工作正常。甚至http://aws_ip:7474/工作正常并且neo4j已连接。但是当我尝试运行neo4j脚本时继续加载并显示time_out.Same代码适用于通过我的local:ip连接的本地php(mamp / wamp)。 我如何从我的php访问aws:port,这个php是在不在aws上的单独的cpanel / hotsing帐户上。我非常感谢任何帮助。 还使用:Amazon Linux AMI。仅安装neo4j。从这里http://cloud.dzone.com/articles/how-deploy-neo4j-instance
代码:
<?php
$data2 ='CREATE (Person:Person {name:”test”}) RETURN Person';
$data2 = array("query" =>$data2);
$data_string = json_encode($data2);
$ch = curl_init('http://aws_ip:7474/db/data/cypher');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
echo $result;
?>