Accessing data from php file protected by shield

In your PHP code are you using the elasticsearch-php client? If so did you configure it to use authentication? https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_security.html#_http_authentication