My fresh DrupalCMS 11.4.5. wil not work because Composer refuses to get loaded in the Status Report, making it unable to use the UI to extend modules. 

Status report, as a result of readiness check: (/web/admin/reports/status#error)

Composer version: Composer was not found. The error message was: Failed to run process: First element must contain a non-empty program name
I used the Haven theme with this install: composer create-project drupal/cms my_site_name

I tried all in this manual but Composer will not be detected so I cannot update or install any module. The manual was given in the code of web/core/modules/package_manager/PackageManagerRequirementsHooks.php on line 70, so I assume it is recent. 

I have followed the referenced document: https://www.drupal.org/node/3540264

did this installation:

composer config allow-plugins.drupal/core-vendor-hardening true
composer config extra.drupal-core-vendor-hardening --merge --json '{"composer/composer": false}'
composer require "drupal/core-vendor-hardening:^11.2.4" "composer/composer:^2.7"

No detection.

Installed composer globally and added a global installation to settings.php: 

$settings['package_manager_composer_path'] = '/usr/local/bin/composer';
it will not detect.
manual says:

Package Manager will only look for Composer in three places:

    Locally installed (preferred): Package Manager will try to find Composer at vendor/composer/composer/bin/composer, 
    and it will use that if it exists.
    A new package_manager_composer_path setting.
    Otherwise, it will look for Composer in the web server's PATH.

I also came across a php setting that should be altered, but searching the web could lead to old information so I was wondering if this might be a clue:

https://github.com/composer/composer/blob/6232291b49a4e9ef36304c37f01953...

it says in the composer code: echo 'Composer cannot be run safely on non-CLI SAPIs with register_argc_argv=On. Abort Set it to off but no working composer.

I'm really stuck right now because of this, hopefully someone can help me fix this.

I'm running on Linux, Apache and nginx, php 8.3.33.

I updated this bug report being more specific.

Comments

jaypan’s picture

What does no detection mean? What is the actual error our output you are getting?

Note that Composer is not part of Drupal, nor does it ship with Drupal. It's a command line tool that requires installation on your server, and that tool acts upon your codebase. 

Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.

marcelboere’s picture

It is an error in the Status Report. With this error it is not possible to extend modules using the UI: 

Composer version: Composer was not found. The error message was: Failed to run process: First element must contain a non-empty program name
I did some error checking in the code and saw that my local composer's settings were read from the composer.json file, so it must be an error somewhere in a module in the DrupalCMS recipes. I used the Haven theme (composer create-project drupal/cms my_site_name);
There's lots of outdated information on the internet, it's difficult to pick out the recent ones.
Is there a way I can help by adding some debugging in the code?
I know composer is not part of Drupal, and it is working as usual installing from the bash shell. It only won't work with the Extend manager in this CMS install somehow.
Installed Drupal core and it worked like charm...
jaypan’s picture

Ok, your system thinks Composer isn't installed. Maybe it's not installed, maybe your system just can't find it. Composer is external to Drupal, and not maintained nor controlled by the Drupal organization, and needs to be installed independently of Drupal.

The first thing to do is get Composer installed on your system; contact your hosting company and ask them how you go about doing that.

Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.

marcelboere’s picture

Thank you for your response. I clarified the issue after your last comment. I do not use DDEV but install DrupalCMS with composer. So it is on my system, globally.

Then I got to the /drupalcms/web/admin/reports/status page seeing this comment:

Errors found: 

Composer version
Composer was not found. The error message was: Failed to run process: First element must contain a non-empty program name
I installed composer locally and did some prints in the code noticing its record in the composer.json file was found, version check ok according to software added error_log statements.

With this issue, I am unable to enable installed modules through the UI and I guess the automatic update cron will also fail.

I have installed two versions op Drupal, one being drupalcms and one being drupal core (updated to 11.4.6 today).

Did not update drupalcms yet, so I will come back after I did that.

I have read lots of information about the new system of recipes and as my drupal core installation does not fire this warning in the status report page, some recipe of drupalcms must cause this.

I will let you know if I found the bug.

marcelboere’s picture

Just as I thought, updating Drupal to 11.4.6 though the UI is also not possible with this installation. I'll use drush and come back on this issue.