skip to Main Content

As a biginner I tried to instrall Magento.its showing error when instralling. first I explian my status.

php version : PHP 8.2.12
XAMP : V3.3.0
Apache/2.4.58
phpMyAdmin : 5.2.1
Composer version 2.6.6 2023-12-08 18:32:26
Elasticsearch: 8.11.3
Magento : 2.4.6

first I download and install Composer.then Elasticsearch. security is enable when I try to open localhost:9200, it ask password. I already reset password using "elasticsearch-reset-password.bat".

step 1:
composer.phar global config http-basic.repo.magento.com abeffa5b80eb43d4ba2a78d0aa4e3696 635c95a490c8682aa942f4cb469e898a

step 2:
composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition

step3:
create database name : m246

step4:
Enable elasticsearch opening this file :
c:/xampp/htdocs/elasticsearch-7.17.0/bin/elasticsearch.bat

Step5:
Install Magento command:-

php bin/magento setup:install –base-url=http://localhost/m246/pub –db-host=localhost –db-name=m246 –db-user=root –db-password= –admin-firstname=admin –admin-lastname=admin –[email protected] –admin-user=admin –admin-password=admin123 –language=en_US –currency=USD –timezone=America/Chicago –use-rewrites=1 –backend-frontname=admin –search-engine=elasticsearch7 –elasticsearch-host=localhost –elasticsearch-port=9200

here is coming error
like this
"In SearchConfig.php line 81:

Could not validate a connection to Elasticsearch. Unknown 401 error from Elasticsearch null"

then I try to run this code
"curl localhost:9200/_cat/health"
answer is :

{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_cat/health]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_cat/health]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","ApiKey"]}},"status":401}

help me to troubleshoot this

2

Answers


  1. You can follow Docker-Magento . Using this you can easily install magento 2 with all dependencies. But it use docker and make our process easier.

    Login or Signup to reply.
  2. You need put the credentials with the params

    --elasticsearch-enable-auth=ELASTICSEARCH-ENABLE-AUTH
    --elasticsearch-username=ELASTICSEARCH-USERNAME
    --elasticsearch-password=ELASTICSEARCH-PASSWORD
    

    see more in this link

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search