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_limitto1.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
关于 LearnKu
我也碰到了这个问题 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 安装依赖即可