I'm working on a live site and I'm trying to install a module using composer, but the proccess is killed. I found out that is due to server RAM. So, I am unable to work with composer, is there any solution?
-
See this topic stackoverflow.com/q/36107400/1293725– Neograph734Commented Mar 17, 2020 at 17:35
-
It s not working, the proccess is killed with their solutions– Reflex RolandCommented Mar 17, 2020 at 18:00
-
3This problem is not suitable for Drupal answers because it is too specifically for composer, but you can try to significantly increase the memory limit (I run composer with 4GB). If that fails check if the server has enough memory or alternatively run composer locally and FTP the files to the server.– Neograph734Commented Mar 17, 2020 at 18:31
1 Answer
Composer is a notorious memory hog, and some web hosts will not allow you to run it on a production server. Even if it is allowed, it is not necessarily a good idea to deploy things this way.
The preferred method is to keep your project in version control (e.g., git
) and then check out a feature branch in your local development environment.
Install the module using Composer in your feature branch, perform any code review, testing, or QA that you need to do, and then do one of the following:
- if you have some form of Continuous Integration / Continuous Delivery set up, you can merge the code into
dev
ormaster
branch and use a git hook to automate build and deploy to the target hosting environment - if you don't have any CI/CD tools, build your site in the local environment and use something like
rsync
(or SFTP) to deploy it to the remote server
-
1
-
2Awesome!
rsync
is a great tool to master. If you can use it manually like this, try writing shell scripts to automate deploy to your target environment and you will be on the road to DevOps automation. In fact, you'll find that CI/CD automation platforms actually usersync
under the hood. Commented Mar 18, 2020 at 1:03