您现在的位置是: 首页 > 后端开发 PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
2020-06-05 【后端开发】 2982人已围观 5146次浏览
简介PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
PHP 在执行 composer install 时出现类似下面的提示
PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
特别是小内存的服务器上容易出现,主要原因就是在执行 composer install 时用到的内存过多,导致超出了设定的内存限制
可以在服务器上运行下面的命令来查看当前默认的内存限制
php -r "echo ini_get('memory_limit').PHP_EOL;"
尝试增加 php.ini 文件的的限制(例如,/etc/php.ini)
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M
找到 memory_limit 这一行,修改后面的 128M 为 -1(无限制)或 2G,保存退出后重新执行,则问题解决
需要注意的时,如果服务器内存太小,又没有 swap 的情况下,依然会出现此类问题,只是修改 php.ini 是解决不了的,问题出在内存大小上
参考文档
https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors
很赞哦! (0)
相关文章
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- springboot引入mybatis-plus后出现ClassNotFoundException: org.mybatis.logging.LoggerFactory
- 记一次Java MessageFormat.format踩坑
- SpringBoot 启动测试时出现提示 Test class should have exactly one public zero-argument constructor
- PHP 中list()出现Undefined offset: 0错误
- SpringBoot 定时任务 多线程
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- SqlServer 刷新所有视图
- 删除Git仓库所有历史提交记录,成为一个干净的仓库
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- win10 cmder Debian 安装配置 oh-my-zsh
- 使用 OpenSSL 将 pfx 格式证书转为 pem 格式
- 迁移 Docker 目录
- PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
- mybatis中大于等于小于等于的写法
- 删除Git仓库所有历史提交记录,成为一个干净的仓库
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
- 记一次 Mybatis-Plus 自动填充无效问题解决
- win10 cmd下运行python命令弹出windows应用商店问题
- Nestedset 出现 Node must exists. 错误解决方案