ethrbunny
ethrbunny

Reputation: 10469

Neo4J: test from php cmd line works but web doesn't?

Using the following bits:

<?php
require('vendor/autoload.php');

$client = new Everyman\Neo4j\Client('localhost', 7474);
print_r($client->getServerInfo());
?>

If I run this as php test.php I get the expected output.

If I run this via http://server/test.php I get connection errors.

[24-Jun-2014 05:49:52] PHP Fatal error:  Uncaught exception 'Everyman\Neo4j\Exception' 
  with message 'Can't open connection to http://localhost:7474/db/data/' in 
  /var/www/html/vendor/everyman/neo4jphp/lib/Everyman/Neo4j/Transport/Curl.php:91

Clearly I've monkeyed up something with either my PHP config or the installation of this library. Suggestions on where to look?

Installed per these instructions.

Running on CentOS 6.4 (x64), PHP 5.3.3

NOTE: I've made successful connections from other machines back to this server so I know the neo4j server is working. It just doesn't seem to want to let me connect locally when called via browser.

Upvotes: 1

Views: 409

Answers (1)

mvladk
mvladk

Reputation: 628

I had same issue, it was caused by SeLinux

Try disabling it by:

 echo 0 >/selinux/enforce

then recheck connection. If solved configure SeLinux permissions. In my case httpd_can_network_connect should be on

 setsebool -P httpd_can_network_connect on
 echo 1 >/selinux/enforce

Helpful manual: http://wiki.centos.org/TipsAndTricks/SelinuxBooleans

Upvotes: 1

Related Questions