作曲家内存限制作曲家、内存

2023-09-06 16:31:00 作者:汏臉貓(⌒ω⌒)

我在 Webhosting-Server 上安装了 composer global.现在我可以通过

I installed composer global at a Webhosting-Server. Now I can call it via

composer

但如果我想安装一些东西,我会收到内存限制错误.现在我想用

But if I want to install something I get a memory limit error. Now I want to call it with

php -d memory_limit=1024M composer.phar

但它不起作用.可能是因为我在全球安装了它.如何通过 shell 使用作曲家获得扩展的 memory_limit?

but it doesn't work. Probably because I installed it globaly. How can I get a extended memory_limit with composer via shell?

谢谢!

推荐答案

直接使用 php CLI 调用 Composer 二进制文件时,需要提供 Composer phar 的完整路径,例如,如果安装在 /usr/local/bin 中,你可以这样调用它:

When calling Composer binary by using php CLI directly, you need to provide the full path to the Composer phar, e.g., if it were installed in /usr/local/bin, you would call it with:

php -d memory_limit=1024M /usr/local/bin/composer.phar