Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Recipe has a Composer dependancy that is not met on Silverstripe Cloud hosting #4

Open
brettt89 opened this issue Apr 28, 2021 · 2 comments

Comments

@brettt89
Copy link

Issue

Recipe currently requires a couple of modules that have a hard dependancy on Composer being installed.

Modules:

These modules require that composer be installed on the web boxes or executable by a user with ability to store cached items. This is currently not supported on Silverstripe Cloud and causes PHP errors to be thrown by the recipe during normal behaviour.

Error

Uncaught Exception RuntimeException: "The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly" at /var/www/mysite/releases/63e07fc364b9f90ab583e83a6f04bb72a26faf20/vendor/composer/composer/src/Composer/Factory.php line 652 {"exception":"[object] (RuntimeException(code: 0): The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly at /var/www/mysite/releases/63e07fc364b9f90ab583e83a6f04bb72a26faf20/vendor/composer/composer/src/Composer/Factory.php:652)"}

How to Replicate

  1. Use CWP Basic Recipe to create website and deploy to Silverstripe Cloud.
  2. Navigate to /dev/tasks URL
  3. PHP Error is presented about HOME and COMPOSER_HOME environment variables not being set.
@brynwhyman
Copy link

brynwhyman commented Apr 28, 2021

Also raised on the bringyourownideas module: bringyourownideas/silverstripe-maintenance#142 (that provides some context on the work already done).

We had previously seen the same issue on the CWP in-nation platform. That was resolved with the following (and was expected to resolve it for SC too): https://github.com/bringyourownideas/silverstripe-composer-update-checker/pull/35/files

@michalkleiner
Copy link

I guess the culprit might be what is mentioned in the most popular comment on the putenv manual page:

putenv/getenv, $_ENV, and phpinfo(INFO_ENVIRONMENT) are three completely distinct environment stores. doing putenv("x=y") does not affect $_ENV; but also doing $_ENV["x"]="y" likewise does not affect getenv("x"). And neither affect what is returned in phpinfo().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants