php - 致命错误:允许的内存大小为 1610612736 字节已用尽但已分配 1.75G
问题描述
我不断收到此内存错误
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
(tried to allocate 67108864 bytes) in
phar:///usr/local/bin/composer/src/Composer/
DependencyResolver/Solver.php on line 220
我已经尝试了一切。已经增加了几次内存限制。我已经重新下载了 composer 和 composer.phar。我在全新安装时克隆了我的 repo,第一个成功了composer install
。由于某种原因,之后的每次尝试都会导致此错误。
我什至从 master 分支和我的分支中删除了可能导致此问题的文件中的任何差异。
PhP 版本 7.1.25 Composer 版本 1.7.2
我在 config.yml 文件中编辑的代码
create_course_space_whitelist_expression: '"staff" in affiliations or
"employee" in affiliations or "faculty" in affiliations or "guest" in
affiliations or "GR" in student_level'
旧代码:
create_course_space_whitelist_expression: '"staff" in affiliations or
"employee" in affiliations or "faculty" in affiliations or "guest" in
affiliations
不知道还能去哪里看。我在 Vendor 中更新了两个创建的文件,但我在运行之前删除了 vendorcomposer install
编辑:
我已经能够缩小原因。composer install
在使用干净版本的 repo 分支时工作正常。但是,当对 composer.json 文件进行任何更改时,它会失败
解决方案
运行此命令为我修复了它
php -d memory_limit=-1 /usr/local/bin/composer install
推荐阅读
- javascript - 缩放和平移后fabricJS中的对象对齐
- ruby-on-rails - 代码优化/更好的方式来操作类名
- java - 为什么 Activiti 7 局部变量与全局变量混合在一起?
- javascript - 无法将自定义操作与自定义减速器 react-admin 连接
- python - 将字符串转换为字典的问题
- terraform - Terraform - 渲染局部值和变量以加快开发速度
- oracle - 如何使用批量收集和 forall 在另一个游标中使用参数化游标
- python - 什么时候在 pytorch 闪电中使用`on_fit_start` 和`setup`?
- typescript - 如何在 TypeScript 泛型中动态指定类型?
- javascript - javascript 虚拟机 vs javascript 运行时 vs webassembly 虚拟机