I've been managing a few Drupal sites from the UI backend for several years, and I want to update my skills by extending my Drupal installations through Composer, as I see it’s the preferred method for installing modules.

My hosting provider uses Installatron, which automatically installs Drupal and creates the database for me, which is very convenient. However, when I install a module (e.g., Webforms) via Composer, I immediately lose access to my admin pages. The main page of the site remains functional, but I get an error when trying to access the backend: 'The website encountered an unexpected error. Please try again later.'

I’ve read that managing modules through Composer means I shouldn’t install them manually via the UI, but I’m wondering if this rule applies on a fresh installation as well. I also noticed that Installatron seems to use Composer since I see a composer.json file in the site’s directory.

Am I on the right track with using Composer for module management? Or is there a different approach I should follow?

Any guidance or suggestions would be greatly appreciated!

Comments

ressa’s picture

This is essentially a rewrite of an old post from 21 dec 2023:

How to get started with Composer? Am I on the right track?

By robbnl on 21 Dec 2023 at 13:52 CET

Hello, For many years I have managed a few Drupal sites from the UI backend. I would like to update my skills and also follow the software development and would like to start extending my Drupal installation through Composer because I see that is the prefered method to install modules.

My hosting provider allows me to deploy a new site with Installatron. That's really convenient because it installs a new site with Drupal, creating the database and such automatically.

However as soon as I install a module through composer (for example webforms) then immediately I loose access to my admin webpages. The newly installed site's main page remains working. Just when I try to access the admin backend I get an error message:  the website encountered an unexpected error. please try again later

My question now is: am I on the right track? I have read that when you manage modules and dependencies through composer you should not install modules manually through the UI. But on a fresh install?

I also do believe that the Installatron mechanism uses composer because I see a composer.json in the site's directory.

Any guidance on wether I am on the right track or should go down a different road would be much appreciated

With friendly greetings,
Rob Bastiaansen

From https://www.drupal.org/forum/support/installing-drupal/2023-12-21/how-to...

This post:

Darshan Hiranandani : How do I begin working with Composer? I’m not sure if I’m approaching it correctly—any advice?

By darshanhiranandani24 on 12 Dec 2024 at 10:30 CET

Hi everyone,

I’m Darshan Hiranandani, I've been managing a few Drupal sites from the UI backend for several years, and I want to update my skills by extending my Drupal installations through Composer, as I see it’s the preferred method for installing modules.

My hosting provider uses Installatron, which automatically installs Drupal and creates the database for me, which is very convenient. However, when I install a module (e.g., Webforms) via Composer, I immediately lose access to my admin pages. The main page of the site remains functional, but I get an error when trying to access the backend: 'The website encountered an unexpected error. Please try again later.'

I’ve read that managing modules through Composer means I shouldn’t install them manually via the UI, but I’m wondering if this rule applies on a fresh installation as well. I also noticed that Installatron seems to use Composer since I see a composer.json file in the site’s directory.

Am I on the right track with using Composer for module management? Or is there a different approach I should follow?

Any guidance or suggestions would be greatly appreciated!

Regards

Darshan Hiranandani