1

So I created a fresh install of Ubuntu 16.04 and installed the LAMP stack, installed phpmyadmin and composer and then finally drush. Everything worked fine until I downloaded and installed Drupal using the "drush pm download" command which worked fine but now my entire drupal site is located in a folder called "drupal-8.6.3". I used to use the wget command and the tar --strip components command to get it properly organized.

I can delete the drupal-8.6.3 directory but how can I download my drupal site using composer or drush from the html folder?

1

Since you are using composer to manage dependencies, you should install Drupal with Composer instead of using drush pm-download:

https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies#download-core

Also, you should use Composer to manage contributed modules instead of using drush pm-install:

https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies#managing-contributed

You can even use Composer to manage third-party libraries:

https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies#third-party-libraries

And to apply patches to Drupal core and contrib modules:

https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies#patches

Don't worry, you'll still use drush for a lot of things -- but once you've switched to using Composer to manage dependencies, you should stick with it as much as possible and avoid using Drush makefiles or installing / upgrading with Drush.

Here's an article with some common "gotchas" you may encounter when managing Drupal with Composer:

https://www.jeffgeerling.com/blog/2017/composer-and-drupal-are-still-strange-bedfellows

  • 1
    One more question as I am working on my home server right now...I have followed the composer command: composer create-project drupal-composer/drupal-project:8.x-dev my_site_name_dir --stability dev --no-interaction and it worked. But now when I go into the html root using my web browser I get a directory listing. Should I change the Document Root in the /etc/apache2/sites-enabled/000-default.conf file? There is also a new "web" folder that I've never seen before. – Kimosabe2016 Nov 26 '18 at 0:34
  • The web directory is your new Document Root. Go ahead and change your Apache 2 config to reflect that. Remember to edit the conf file in sites-available because the entry in sites-enabled is a symbolic link generated by a2ensite. – hotwebmatter Nov 26 '18 at 0:58
  • Everything is working now, I made the necessary changes in sites-available.conf and added this line at the end of the settings.php file: $config_directories = array(CONFIG_SYNC_DIRECTORY => 'sites/default/files/config_HASH',); – Kimosabe2016 Nov 26 '18 at 1:54
  • Hmm, OK. I meant to edit sites-available/000-default.conf if that was the one you were using. But I'm glad to hear you got it working! – hotwebmatter Nov 26 '18 at 2:24
  • Matt - I made the changes to the sites-available/000-default.conf file and drupal wouldn't install because it couldn't create the /config/sync folder. So I googled and found the solution. Now can drush change the permissions back or do I manually put them back? – Kimosabe2016 Nov 26 '18 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.