- Docker Php Composer Install
- Docker Php Composer Installation
- Docker Php Composer Installer
- Docker Php-fpm Install Composer
Install PHP 7.2.5 or higher and these PHP extensions (which are installed and enabled by default in most PHP 7 installations): Ctype, iconv, JSON, PCRE, Session, SimpleXML, and Tokenizer; Install Composer, which is used to install PHP packages. Optionally, you can also install Symfony CLI. In short, it is a script provided by the official PHP Docker image that you can use to easily install extensions. For more information read the documentation. Now that we created the script that contains all prerequisites for our build environment, let’s add it in.gitlab-ci.yml.
We use Composer to manage Magento components and their dependencies. Using Composer to get the Magento software metapackage provides the following advantages:
- Reuse third-party libraries without bundling them with source code
- Reduce extension conflicts and compatibility issues by using a component-based architecture with robust dependency management
- Adhere to PHP-Framework Interoperability Group (FIG) standards
- Repackage Magento Open Source with other components
- Use the Magento software in a production environment
You can also download an archive file for a specific version of Magento in either ZIP or TAR format. Installing Magento from an archive lacks the advantages of using Composer. Contributing developers should use the git-based installation method.
Prerequisites
Before you continue, you must do the following:
- Set up a server that meets our system requirements.
- Complete all prerequisite tasks.
- Create and switch to the Magento file system owner.
- Install Composer.
- Obtain authentication keys for the Magento code repository.
Log in as file system owner
Learn about ownership, permissions, and the Magento file system owner in our Overview of ownership and permissions topic.
To switch to the Magento file system owner:
Log in to the Magento server as, or switch to, a user with permissions to write to the Magento file system. See switch to the Magento file system owner.
If you use the bash shell, you can use the following syntax to switch to the Magento file system owner and enter the command at the same time:
If the Magento file system owner does not allow logins, you can do the following:
To run Magento commands from any directory, add
<magento_root>/bin
to your systemPATH
.Because shells have differing syntax, consult a reference like unix.stackexchange.com.
Sample bash shell for CentOS:
Optionally, you can run the commands in the following ways:
cd <magento_root>/bin
and run them as./magento <command name>
<magento_root>/bin/magento <command name>
<magento_root>
is a subdirectory of your web server docroot.
In addition to the command arguments discussed here, see Common arguments.
Get the metapackage
To get the Magento metapackage:
- Log in to your Magento server as, or switch to, the Magento file system owner.
- Change to the web server docroot directory or a directory that you have configured as a virtual host docroot.
Create a new Composer project using the Magento Open Source or Magento Commerce metapackage.
Magento Open Source
Magento Commerce
When prompted, enter your Magento authentication keys. Public and private keys are created and configured in your Magento Marketplace.
If you encounter errors, such as
Could not find package...
or...no matching package found
, make sure there are no typos in your command. If you still encounter errors, you may not be authorized to download Magento Commerce. Contact Magento support for help.See troubleshooting for help with more errors.
Magento Commerce customers can access 2.4.x and 2.3.x patches two weeks before the General Availability (GA) date. Pre-release packages are available through Composer only. You cannot access pre-releases on the Magento Portal or GitHub until GA. If you cannot find these packages in Composer, contact Magento Support.
Example - Minor release
Minor releases contain new features, quality fixes, and security fixes. Use Composer to specify a minor release. For example, to specify the Magento Commerce 2.4.0 metapackage:
Example - Quality patch
Quality patches primarily contain functional and security fixes. However, they can also sometimes contain new, backward-compatible features. Use Composer to download a quality patch. For example, to specify the Magento Commerce 2.3.4 metapackage:
Example - Security patch
Security patches contain security fixes only. They are designed to make the upgrade process faster and easier.
Security patches use the Composer naming convention 2.3.2-px
. Use Composer to specify a patch. For example, to download the Magento Commerce 2.3.2-p1 metapackage:
Set file permissions
Docker Php Composer Install
You must set read-write permissions for the web server group before you install the Magento software. This is necessary so that the command line can write files to the Magento file system.
Install Magento
You must use the command line to install Magento.
Docker Php Composer Installation
This example assumes that the Magento install directory is named magento2ee
, the db-host
is on the same machine (localhost
), and that the db-name
, db-user
, and db-password
are all magento
:
You can customize the Admin URI with the --backend-frontname
option. However, we recommend omitting this option and allowing the installation command to automatically generate a random URI. A random URI is harder for hackers or malicious software to exploit. The URI displays in your console when installation is complete.
For a full description of the CLI install options, refer to Install the Magento software from the command line.
Command summary
To display a complete list of commands, enter:
To get help for a particular command, enter:
For example,
The following table summarizes the available commands. Commands are shown in summary form only; for more information about a command, click the link in the Command column.
Command | Description | Prerequisites |
---|---|---|
magento setup:install | Installs the Magento software | None |
magento setup:uninstall | Removes the Magento software. | Magento software installed |
magento setup:upgrade | Updates the Magento software. | Deployment configuration |
magento maintenance:{enable/disable} | Enables or disables maintenance mode (in maintenance mode, only exempt IP addresses can access the Magento Admin or storefront). | Magento software installed |
magento setup:config:set | Creates or updates the deployment configuration. | None |
magento module:{enable/disable} | Enable or disable modules. | None |
magento setup:store-config:set | Sets storefront-related options, such as base URL, language, timezone, and so on. | Deployment configuration |
Database (simplest way is to use magento setup:upgrade) | ||
magento setup:db-schema:upgrade | Updates the Magento database schema. | Deployment configuration |
magento setup:db-data:upgrade | Updates the Magento database data. | Deployment configuration |
magento setup:db:status | Checks if the database is up-to-date with the code. | Deployment configuration |
magento admin:user:create | Creates a Magento administrator. | All of the following: Deployment configuration Enable at minimum the Magento_User and Magento_Authorization modules Database (simplest way is to use magento setup:upgrade) |
magento list | Lists all available commands. | None |
magento help | Provides help for the specified command. | None |
Common arguments
Docker Php Composer Installer
The following arguments are common to all commands. These commands can be run either before or after the Magento software is installed:
Long version | Short version | Meaning |
---|---|---|
--help | -h | Get help for any command. For example, ./magento help setup:install or ./magento help setup:config:set . |
--quiet | -q | Quiet mode; no output. |
--no-interaction | -n | No interactive questions. |
--verbose=1,2,3 | -v, -vv, -vvv | Verbosity level. For example, --verbose=3 or -vvv displays debug verbosity, which is the most verbose output. Default is --verbose=1 or -v . |
--version | -V | Display this application version |
--ansi | n/a | Force ANSI output |
--no-ansi | n/a | Disable ANSI output |
Docker Php-fpm Install Composer
Hooray! You’ve completed the quick install. Need more advanced help? Check out our Advanced install guide.