Here is what you want to do to at least get through the setup of the codebase.
1. Create Magento Account
In order to composer install the magento codebase, you need access keys which are generated from a Magento marketplace account. You must create an account on Magento to get to your marketplace profile to generate access keys.
- Go here to create an account if you don't already have one: Magento Login
- Once logged in, click the "Marketplace" tab on your account: Marketplace
- Click the "Access Keys" link below the "My Products" section on your account dashboard
- Generate access keys and copy/write them down. They will be used in the next step
2. Add Composer Auth File to Your Project
In the root of your Magento codebase, you will need to add an auth.json
file with the following contents, replacing the username and password with the access keys you generated:
{
"http-basic": {
"repo.magento.com": {
"username": "__YOUR_ACCESS_KEY_USERNAME__",
"password": "__YOUR_ACCESS_KEY_PASSWORD__"
}
}
}
Exception: If some of the extensions used in this project were purchased through the Magento marketplace, you have to use the access keys associated with the Marketplace Account those extensions were purchased under. Otherwise you won't have access to those extensions and will continue to get authentication errors.
3. Add Additional Auth Credentials For Third Party Composer Packages
There may be composer packages used in this project for third party modules and they may be behind a protected composer repository the way Magento is. It sounds like this is the case from what you are describing, so the person whom is giving you access will probably need to share their auth.json
with you. It should contain additional entries similar to what you see in the above auth.json
but with urls and credentials to the other composer repositories used in the project
4. Composer Install Your Project
You should now be able to run the composer install
command. If you get any errors about PHP version or certain system constraints, you can instead run composer install --ignore-platform-reqs
to have composer ignore platform requirements
5. Config.php and Env.php
Ideally the app/etc/config.php
file should be tracked in the git repo as it's a record of which modules are enabled and disabled. The person giving you access should add this file to the git repo.
The app/etc/env.php
file is going to contain the encryption key which I believe you are going to need if the person is giving you an already populated database to use.
Technically you don't need either of these files, but I'm not sure what the effect will be if you are being supplied a database. The env.php
file contains the encryption key used for passwords and what not, so that may cause issues if you don't use the same encryption key.
Assuming you can't get either file, you might still be fine. You'll just need go through the previous steps, then visit the site you have configured and it should present you with the installation screen for Magento.
Notes On Composer
You should avoid editing or removing the composer.lock
file as MUCH as possible. This file is used to lock all of your composer dependencies at the versions specified in the composer.json
. It makes it so that every time you run composer install
you get the same versions you originally added.
Even when adding/removing composer packages, it's preferred that you run composer require vendor/package
or composer remove vendor/package
instead of editing the composer.json
file directly. The reason for this is that when you require/remove packages, composer automatically adds/removes content from the composer.lock
file for you. When you make manual changes to either of these files, they can become out of sync and cause unexpected issues.