-
Hi,
I have noticed that Composer comes pre-installed with the Cloudron LAMP stack. If I change into a terminal, I can use it by executing "composer". However, if I run the following command:
root@5585a070-9420-4f84-bd98-5198b471ffb4:/app/data/public# composer require drush/drush Cannot create cache directory /root/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /root/.composer/cache/files/, or directory is not writable. Proceeding without cache Do not run Composer as root/super user! See https://
I see that Composer is not able to create its cache. Also it gets killed, when I try to require a package:
root@5585a070-9420-4f84-bd98-5198b471ffb4:/app/data/public# composer require drush/drush Cannot create cache directory /root/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /root/.composer/cache/files/, or directory is not writable. Proceeding without cache Do not run Composer as root/super user! See https://getcomposer.org/root for details Using version ^9.5 for drush/drush ./composer.json has been updated Cannot create cache directory /root/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /root/.composer/cache/files/, or directory is not writable. Proceeding without cache Loading composer repositories with package information Updating dependencies (including require-dev) Killed root@5585a070-9420-4f84-bd98-5198b471ffb4:/app/data/public#
What am I doing wrong? Is there an error on your end? Could not find any info about Composer usage. I need Composer for my PHP app.
Kind regards
Peter -
The
Killed
at the end is because composer ran out of memory. By default, the package only has 256MB memory, increasing it should fix the problem.As for running composer as root, the packaging is to blame. I am looking into fixing this.
-
For reference, the killed issue is also documented here - https://github.com/composer/composer/issues/1815
-
@jepster We have pushed an update that should make it simpler now. Also updated the docs - https://cloudron.io/documentation/apps/lamp/#running-composer