Update Extensions page error if Composer not found

Created on 20 January 2025, about 2 months ago

Problem/Motivation

Installed Drupal on a shared hosting server where it couldn't find the Composer executable.
On the Extend page most tabs show an error message that Composer can't be found.

The Extend->Update Extensions tab has an uncaught exception instead.
The exception is "PhpTuf\ComposerStager\API\Exception\LogicException: The composer executable cannot be found. Make sure it's installed and in the $PATH in PhpTuf\ComposerStager\Internal\Finder\Service\ExecutableFinder->find() (line 34 of [path-to]/vendor/php-tuf/composer-stager/src/Internal/Finder/Service/ExecutableFinder.php)."

Composer is installed and was used to get the Drupal files. I don't know why it couldn't find the Composer executable, my guess is it's a permissions issue?

Steps to reproduce

Install Drupal
Make sure Composer isn't in the $PATH
Check Extend->Update for message that the Composer executable can't be found
Go to Extend->Update Extensions tab - this will give an exception

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.1 πŸ”₯

Component

package_manager.module

Created by

πŸ‡¦πŸ‡ΊAustralia juxe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @juxe
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β†’ .

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    The "Update Extensions" page is actually not in core; it's part of the contributed Automatic Updates module. (Package Manager has no UI at all.) Moving to the appropriate issue queue.

  • πŸ‡¬πŸ‡§United Kingdom catch

    Since this is a user facing fatal error, bumping to critical.

    We might need a second issue to try to investigate further why the executable can't be found too.

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    Same issue here.

    I installed Drupal CMS on a shared hosting server and visiting 'Browse' shows the error,

    Unable to download modules via the UI: The composer executable cannot be found. Make sure it's installed and in the $PATH

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    I tried to place a copy of composer.phar on my host server but that didn't work. This is what I did.

    I navigated to the root of my host account where I have vendor folder then I ran the following commands:

    curl -sS https://getcomposer.org/installer | php

    chmod +x composer.phar

    Then I added this in settings.php,

    $settings['composer_executable'] = '/home/username/composer.phar';

    This doesn't work.

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    I am sorry my issue is not really what this issue is all about - only related.

  • πŸ‡§πŸ‡·Brazil btriest

    I have the same issue here.

    I installed Drupal CMS on a shared hosting as well and visiting 'Browse' shows the error,

    Unable to download modules via the UI: The composer executable cannot be found. Make sure it's installed and in the $PATH

Production build 0.71.5 2024