I am using following command to install magento 2.4.7 in xampp on windows platform,
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.7 magento2
I am getting following error, enter image description here
Note : I know my private key and public key, when i enter the command it's never asking the details
-
Did you add your magento public and private key when composer ask or you can add it in your root auth.json fileZahirabbas– Zahirabbas2024年12月03日 12:35:40 +00:00Commented Dec 3, 2024 at 12:35
-
@Zahirabbas After added auth.json file under C:\xampp\htdocs getting same error, pls correct me if i am wrong.zus– zus2024年12月03日 14:59:05 +00:00Commented Dec 3, 2024 at 14:59
-
hello, @zus your error is solved or not.?mohit vamja– mohit vamja2024年12月10日 13:40:17 +00:00Commented Dec 10, 2024 at 13:40
-
@mohitvamja Not yet.zus– zus2024年12月11日 08:03:49 +00:00Commented Dec 11, 2024 at 8:03
-
1Check if it's happening because ipV4 is not working correctly. Follow steps in the answer of this question - stackoverflow.com/questions/73015187/…Vivek Kumar– Vivek Kumar2024年12月17日 07:04:50 +00:00Commented Dec 17, 2024 at 7:04
5 Answers 5
Create auth.json file in your root directory with your public and private key with below code.
{
"http-basic": {
"repo.magento.com": {
"username": "sdfdsfdsfdsfdsfdsfsdfdsfsdfdsfsd",
"password": "sdfdsfdsfsdfsdfsdfsdfsdfd"
}
}
}
To install Magento 2 using the command line, you need to configure the public and private keys in Composer. These keys are required to authenticate with Magento's repository.
Here’s the command to set the private and public key in Composer:
composer config --global http-basic.repo.magento.com <public_key> <private_key>
Replace:
<public_key>: Your Magento Marketplace public key.<private_key>: Your Magento Marketplace private key.
Example:
If your public key is abc123 and your private key is xyz789, the command would look like this:
composer config --global http-basic.repo.magento.com abc123 xyz789
Once the keys are set, you can proceed with installing Magento 2 using Composer. Let me know if you'd like detailed installation steps!
-
-
@zus You're still getting the same error?Kishan Savaliya– Kishan Savaliya2024年12月11日 12:23:16 +00:00Commented Dec 11, 2024 at 12:23
-
Try to run
composer clear-cachecommand once and after that try to run above config command and next magento installation command, make sure you remove magento2 directory before running commands again.Kishan Savaliya– Kishan Savaliya2024年12月11日 12:26:19 +00:00Commented Dec 11, 2024 at 12:26 -
Hi, any help on this magento.stackexchange.com/q/375850/57334zus– zus2024年12月13日 10:11:41 +00:00Commented Dec 13, 2024 at 10:11
Make sure your internet connection is stable. Verify that the curl library is enabled in your XAMPP setup and ensure all other libraries required for Magento 2 are properly configured. Additionally, check your Composer version for compatibility.
If the problem continues, you may try using WAMP software as an alternative.
We shouldn't install Magento on the Windows hosting machine. I encourage you to use Docker and Warden tool to setup your Magento project.
In your case, you can add the verbose mode -vvv to see more details.
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.7 mage247test -vvv
-
I am getting following error once i run the command, [Composer\Downloader\TransportException] curl error 60 while downloading repo.magento.com/packages.json: SSL certificate problem: unable to get local issuer certificatezus– zus2024年12月13日 15:54:58 +00:00Commented Dec 13, 2024 at 15:54
-
If i run composer create-project --repository-url=repo.magento.com magento/project-community-edition=2.4.7 mage247test -vvv , I am getting an error, any idea about this error, i.sstatic.net/Cbocq7Pr.pngzus– zus2024年12月16日 10:40:58 +00:00Commented Dec 16, 2024 at 10:40
-
1@zus please change the Wifi Network and try again.Khoa Truong– Khoa Truong2024年12月17日 13:38:09 +00:00Commented Dec 17, 2024 at 13:38
On Windows operating systems, the problem might be caused by a DNS issue. Try flushing the DNS cache by running the following command: ipconfig /flushdns.
Source: https://stackoverflow.com/a/76842312.
Instructions to Flush DNS on Windows:
For Windows 10 and Windows 11
1. Open Command Prompt as Administrator:
- Press Windows Key + S to open the search bar.
- Type cmd or Command Prompt.
- Right-click on Command Prompt from the search results and select Run as administrator.
2. Flush DNS Cache:
- In the Command Prompt window, type the following command and press Enter:
ipconfig /flushdns
You should see a message saying:
Successfully flushed the DNS Resolver Cache.
3. Close the Command Prompt:`
Once the message appears, you can close the Command Prompt window.
For Windows 7 and Windows 8:
1. Open Command Prompt as Administrator:
- Press the Windows Key, type cmd or Command Prompt.
- Right-click Command Prompt from the search results and choose Run as administrator.
2. Flush DNS Cache:
- In the Command Prompt window, type the following command and press Enter:
ipconfig /flushdns
- You should see a confirmation message saying:
Windows IP Configuration. Successfully flushed the DNS Resolver Cache.
3. Close the Command Prompt:
- After the message appears, you can close the Command Prompt.