运行composer命令退出
1 2 3 4 5 6 |
# composer require laravel/sanctum Using version ^2.4 for laravel/sanctum ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Killed |
查找composer安装位置
1 2 |
which composer /usr/local/bin/composer |
官方文档-内存限制错误
https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors
composer运行需要1.5G以上内存
Note: Composer internally increases the memory_limit to 1.5G.
查询当前PHP内存限制,如果是-1则当前未限制内存
1 |
php -r "echo ini_get('memory_limit').PHP_EOL;" |
强制限制composer内存占用(不建议,限制过小会报错)
1 |
COMPOSER_MEMORY_LIMIT=1024M composer require laravel/sanctum |
运行top命令查看占用过多内存的程序
重启程序释放内存
1 |
service mysql restart |
There are no comments yet