-1

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 – Neograph734 Mar 17 at 17:35
  • It s not working, the proccess is killed with their solutions – Reflex Roland Mar 17 at 18:00
  • 3
    This 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. – Neograph734 Mar 17 at 18:31
2

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 or master 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
| improve this answer | |
  • 1
    I used rsync and worked locally, thank you! – Reflex Roland Mar 17 at 23:59
  • 2
    Awesome! 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 use rsync under the hood. – hotwebmatter Mar 18 at 1:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.