CentOs不会增加内存限制[关闭] 。

问题描述 投票:0回答:1

我的VPS使用CyberPanel的CentOs 7,当我试图使用 composer install 我得到这个错误

PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 268435456 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 268435456 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

截图

one

two

有什么想法吗?

centos composer-php cyber-panel
1个回答
0
投票

找到正确的 php.ini 使用以下命令为你的PHP CLI SAPI添加。

php -i | grep 'ini'

添加 memory_limit = -1 用文本编辑器将其添加到这个文件中。

你也可以用......或......来增加一个命令的内存限制。

COMPOSER_MEMORY_LIMIT=-1 composer update

...或...

php -d memory_limit=-1 /user/bin/composer update

-1
投票

已解决

我使用这个命令,我的作曲家开始执行

which composer

要找到我的作曲家之路,然后

php -d memory_limit=-1 /user/bin/composer update
© www.soinside.com 2019 - 2024. All rights reserved.