Closed chongshengdz closed 2 years ago
@chongshengdz can you try using v8.0.0-RC1 ? Thanks.
Many thanks for the reply. i will try it later today.
@chongshengdz can you try using v8.0.0-RC1 ? Thanks.
same error message,maybe need to install the elastic-transport-php library?
@chongshengdz can you try using v8.0.0-RC1 ? Thanks.
PHP Fatal error: Uncaught Error: Class "Composer\InstalledVersions" not found in /transport/src/Transport.php:439, referer:
Connection could not be established.The client noticed that the server is not Elasticsearch and we do not support this unknown product× Read Timeout
@chongshengdz I released elastic-transport-php
v8.0.0-rc4 and elasticsearch-php
v8.0.0-rc2. In order to install these RC versions you need to install elastic-transport-php
and after elasticsearch-php
as follows:
composer require elastic/transport:8.0.0-rc4
composer require elasticsearch/elasticsearch:8.0.0-rc2
This will produce the following composer.json
:
"require": {
"elastic/transport": "8.0.0-rc4",
"elasticsearch/elasticsearch": "8.0.0-rc2"
}
Regarding the error message The client noticed that the server is not Elasticsearch and we do not support this unknown product
this means you are using a previous 7.x version of Elasticsearch server or a not supported product. Starting from version 8 the elasticsearch-php
client supports only Elasticsearch 8+ server.
composer require elasticsearch/elasticsearch:8.0.0-rc2
I did follow your above instruction. but the error still persist. PHP Fatal error: Uncaught Error: Class "Composer\InstalledVersions" not found in /vendor/elastic/transport/src/Transport.php:439 I am using elasticsearch version 8.1.0 elasticsearch-php v8.0.0-rc2 elastic-transport-php v8.0.0-rc4 php 8.0+
$this->client = \Elastic\Elasticsearch\ClientBuilder::create()->setHosts($host)->build(); is it correct?
Composer version 1.10.22 2021-04-27 13:10:45 centos 7
it works fine after upgrading to Composer 2.0+. the problem is due to i was using an old version of 1.0+. "Composer\InstalledVersions" is only available on Composer 2.0+.
[8.0 alpha]PHP Fatal error: Uncaught Error: Class "Elastic\Transport\TransportBuilder" not found in /src/ClientBuilder.php:315