Questions about Symfony Composer
Hello! I am trying to set up a Symfony project after cloning it from git. I apologize if these are silly questions, but this is the first time I am trying to do this, so I apologize in advance.
First, I have tried to run composer install at /var/www/html/mydomain.com/symfony, but I get this error:
proc_open(): fork failed - Cannot allocate memory
I have only set up apache, mysql, phpmyadmin and git, and apart of the setup I am trying to do, there is nothing else running, no visitors…
Could you please help me find out why is this happening?
The other question is about composer and file permissions. Based on your setup documents, I have created a user called plainuser, which is not root, and when I have created the virtual host and the folder for mydomain.com, I have followed this article:
https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04/
Without sudo, I, as plainuser, cannot do anything because the user doesn't have permissions, so I cannot run composer update
without sudo either. But running it with sudo, I get the message saying that it is a security risk to run it with sudo… Is there a solution to this?
Thank you very much for your help!
1 Reply
proc_open(): fork failed - Cannot allocate memory
The first error you’re encountering is typically due to your Linode not having enough free memory. Based on a few sources I found online, it is expected that your server has at least 1GB of free RAM, meaning you’ll want to use a Linode 2GB or higher. You can use a Nanode, but in that case some of your RAM is eaten up by other processes, so you don’t actually have a full gig to devote to Composer.
The following Github page goes into more discussion on the problem along with some different soluations:
https://github.com/composer/composer/issues/945
Without sudo, I, as plainuser, cannot do anything because the user doesn't have permissions, so I can not run composer update without sudo either. But running it with sudo, I get the message saying that it is a security risk to run it with sudo… Is there a solution to this?
So this is a bit of a tricky one, but it's likely related to the way you installed Composer. While researching this I found the following Snipe.net article which covers the problem you're having in a ton of detail. Please give the following a read try out the suggestions mentioned.
https://snipe.net/2017/11/15/so-you-ran-composer-as-root/