I have an Elasticsearch-PHP application and it works locally. However, when I put it on an RHEL 6 server that only supports PHP 5.3, it does not work. When I go to the console, I get GET http://xx.x.xxx.xxx:xxxx/init.php 500 (Internal Server Error). The problem I think might be from a connection issue in the init.php. Here's the code inside init.php:
<?php require_once 'vendor/autoload.php'; use Elasticsearch\ClientBuilder; /*Build connection*/ $hosts = [ 'xx.x.xxx.xxx', // Port ]; $es = ClientBuilder::create() // Instantiate a new ClientBuilder ->setHosts($hosts) // Set the hosts ->build(); // Build the client object ?>
This works perfect locally. I don't know why it doesn't work when I transfer it to the server.