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
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 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 安装依赖即可

3年前 评论

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