Define the directories to which Drupal projects should be downloaded if neededĭownload contributed modules and themes using Composer.Download contributed modules and themes using Composer.This chapter has the following sub-sections: Sites may encounter critical update problems if they mix Composer updates and other update methods. If you downloaded Drupal core using Composer, or if one of your modules requires Composer, you should also use Composer to download all modules and themes using Composer. Some of these modules can only be installed using Composer. It is increasingly common that contributed Drupal modules have dependencies to third party libraries. Download contributed modules, themes and their dependencies using Composer If you are used to building Drupal site via Drush make, refer to the FAQs in Drupal's Composer template documentation to learn the difference between this option and Drush make. Run composer install to download Drupal and all its dependencies.For example, to change the sub-directory from 'web' to something else, the keys to modify are the 'extra' sub-keys 'web-root' (under 'drupal-scaffold') and 'installer-paths'. Change directories to my_site_name and edit the composer.json file to suit your needs.Run composer create-project -no-install drupal/recommended-project my_site_name.For example, it is possible that you want to rename the subdirectory 'web' to something else. If you want to modify some of the properties of the downloaded composer.json before composer install is executed, use the -no-install flag when running composer create-project. web/core/scripts/drupal quick-start demo_umami and see a demo site. After creating the project you could type php. If you are evaluating Drupal and just want to see a site, you might try the quickstart feature. Without any arguments it'll install the standard profile and ask only for database credentials. Add Drush in your project by running: composer require drush/drush and use drush site:install to run the command line setup wizard. You can use Drush to install Drupal from the command line. It'll ask for the database credentials, a name for the admin user and some basic information. If this is the case then you can create the drupal project with this command: docker run -rm -i -tty -v $PWD:/app composer create-project drupal/recommended-project my_site_name -ignore-platform-reqs Install Drupal using the standard web interfaceĪfter composer finishes downloading the packages, you can navigate your browser to your site's url and start the setup. You might be using a docker based workflow and therefore do not have composer and its dependencies already installed. For the latest 9.3 version, use drupal/recommended-project:^9.3 in the above command, or drupal/recommended-project:^9 for latest Drupal 9 version. For example, to download version 9.3.12: composer create-project drupal/recommended-project:9.3.12 my_site_nameĪll releases can be found at. If you want a different version, add the version number to the command after a colon. Note that the above command will download the current official release of Drupal. The web root will be the my_site_name/web directory, and typically the full path to that directory will be used as DocumentRoot (if you are using the Apache webserver). The my_site_name directory will contain files that should be outside of your web root and not accessible by the web server. This will create a project in the my_site_name directory and automatically executes composer install to download the latest stable version of Drupal and all its dependencies. Create a projectįor Drupal 10: composer create-project drupal/recommended-project my_site_nameįor Drupal 7: composer create-project drupal-composer/drupal-project:7.x-dev -n my_site_name Other approaches can be found below.įor Drupal 7, use drupal-composer/drupal-project. This template ensures Drupal Core dependencies are the exact same version as the official Drupal release. As of the release of Drupal 8.8.0 - the recommend composer template changed from drupal-composer/drupal-project to the officially supported: drupal/recommended-projectįor Drupal 10, use the composer template at drupal/recommended-project.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |