Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. LAMP stack Composer: Cannot require any package, cannot write into cache

LAMP stack Composer: Cannot require any package, cannot write into cache

Scheduled Pinned Locked Moved Solved LAMP
lamp
4 Posts 2 Posters 846 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jepster
    wrote on last edited by girish
    #1

    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

    1 Reply Last reply
    0
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        For reference, the killed issue is also documented here - https://github.com/composer/composer/issues/1815

        1 Reply Last reply
        0
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #4

          @jepster We have pushed an update that should make it simpler now. Also updated the docs - https://cloudron.io/documentation/apps/lamp/#running-composer

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Bookmarks
          • Search