服务器作曲家安装--no-dev被杀死
在服务器上,当我尝试更新软件包时
In server when I try update packages
composer install --no-dev
结果是
我该如何解决?
composer install
似乎正在尝试更新软件包,因此您的项目中可能没有composer.lock
文件.在这种情况下,composer install
的作用类似于composer update
,这需要大量的内存.您的服务器可能没有足够的内存,并且进程被操作系统杀死.
It looks like composer install
is trying to update packages, so you probably does not have composer.lock
file in your project. In that case composer install
works like composer update
which requires a lot of memory. Your server probably does not have enough memory and process gets killed by OS.
解决此问题的最简单方法是在开发环境中生成composer.lock
,将其提交到项目中,然后在具有composer.lock
的项目上的服务器上运行composer install
.从composer.lock
安装依赖项很便宜,因此应该没有任何与内存相关的问题.
The easiest way of solving this would be to generate composer.lock
on dev environment, commit it into project, and then run composer install
on server on project with composer.lock
. Installing dependencies from composer.lock
is cheap, so there should not be any memory-related problems.
如果无法执行此操作,则需要在服务器上增加内存-启用交换功能或购买具有更多RAM的服务器.
If you can't do this, you need to more memory on your server - either enable swap or buy server with more RAM.