Allowed memory size of 1610612736 bytes exhausted

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

Memory limit errors#

Composer may sometimes fail on some commands with this message:

PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>

In this case, the PHP memory_limit should be increased.

Note: Composer internally increases the memory_limit to 1.5G.

To get the current memory_limit value, run:

php -r "echo ini_get('memory_limit').PHP_EOL;"

Try increasing the limit in your php.ini file (ex. /etc/php5/cli/php.ini for Debian-like systems):

; Use -1 for unlimited or define an explicit value like 2G
memory_limit = -1
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 1

我也碰到了这个问题 1.变更 php.ini 配置文件 我变更了两个位置,一个路径 /etc/php/7.3/cli/php.ini,另外一个是 /etc/php/7.3/fpm/php.ini 我先变更了 fpm 文件夹下的,composer 安装的时候依然报错,然后变更了 cli 文件夹下的,此时 composer 成功

2.vim 编辑 readonly 文件如何处理

3.如何重启 php-fpm 服务 ll /etc/init.d | grep php 即可查看 service 支持哪些命令,然后 service php7.3-fpm restart即可重启,之后,composer 安装依赖即可

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!