Hello All,
I've installed Drupal 8 using instructions from (Composer to Install Drupal):
Using drupal-composer/drupal-project
To do the default install:
Run composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --no-interaction
=========
Now it's time to install modules using Composer. I am not yet Git or Composer savvy.
Drupal Instructions say: "This needs to be executed at the root of your Drupal install but not at the same level as the core directory."
The "project name" folder ( aka my_site_name_dir ) is the first folder whose children contain any are Drupal files.
=========
My question is what folder is considered to be "the root of your Drupal install"
1) Is it the directory with the project name which I gave it: my_site_name_dir ?
2) …Or in my case the directory above "my_site_name_dir" which is "public_html"
=========
Here's a diagram:
public_html
|
|
my_site_name_dir (project name)
[ .editorconfig .env.example .git/ .gitattributes .gitignore .travis.yml composer.json composer.lock config/ drush/ LICENSE load.environment.php phpunit.xml.dist README.md robots.txt scripts/ vendor/ web/ ]
|
|
web
Thanks in advance :)
- garvin
Comments
=-=
root of install is where index.php is
No, my_site_name_dir would be the root
also called project folder. With my_site_name_dir/web being the folder called DocumentRoot, containing the index.php.
my_site_name_dir is the folder that contains your composer.json. cd into it and use "composer require" to add modules to your codebase.
Solved! - Location of Drupal Root ( aka Project Directory )
Thank you both!
VM, I too wondered about root being where the index.php was to be found but the instructions state "but not at the same level as the core directory." So that further confused me as I am not accustom schemas where directories are remapped.
mmjvb, thanks for getting me back on track and now I think I understand that "Drupal root" and "Document root" are two different things.
- garvin :)
They should be two different things.
With the DocumentRoot called anything you want: docroot, web, html, public_html, ......
All trying to make clear that a domain is mapped to that folder. Which means its contents is available from internet.
The Project Directory, whatever you want to call it, is used in the "composer create-project" command. The name should be meaningful to identify your project. Whatever that may be. One of the folders would be DocumentRoot. When using composer it has composer.json, composer.lock and in most cases the folder vendor. Unfortunately, their existance doesn't mean composer is in use. You need to check the contents.