Composer problem (500 Internal Server) |
[eluser]CJL01[/eluser]
I'm trying to add the ElasticSearch PHP client (https://github.com/nervetattoo/elasticsearch) to my CI project using composer. The install went cleanly and I can see the ./vendor directory no problem. I included '/vendor/autoload.php' in my index.php file, but I'm struggling to use the library in my code. The readme for the package (copied from github) says I should use: Code: use \ElasticSearch\Client; But the 1st line doesn't seem to make sense as PHP is rejecting the initial slash resulting in a 500 Server Error. Removing it doesn't work either... Any ideas?
[eluser]CJL01[/eluser]
After many different permutations I finally stumbled on the solution, which is to simply merge the two lines. I also needed to change to a different way of making the connection using an array instead of a URL. Code: $es = \ElasticSearch\Client::connection(array('servers' => '127.0.0.1:9200', Hope this can help somebody else. |
Welcome Guest, Not a member yet? Register Sign In |