安装 jwt-auth 出错,显示 PHP 的内存不足错误

问题:
PHP 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
修改了Homestead的内存和php.ini的limit_memory后都没有效果,还是报错。

安装 jwt-auth出错,显示php的内存不足错误

安装 jwt-auth出错,显示php的内存不足错误

大家有没有碰到类似问题,是怎么解决的?

《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 2

我的也一样,同样的问题

➤ composer require tymon/jwt-auth 1/1: mirrors.aliyun.com/composer/p/prov... Finished: success: 1, skipped: 0, failure: 0, total: 1 Using version ^1.0 for tymon/jwt-auth ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) PHP 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

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

Check getcomposer.org/doc/articles/troub... for more info on how to handle out of memory errors.⏎

4年前 评论

我的解决方法是, 找到 composer.json 文件, 手动把 "tymon/jwt-auth": "^1.0.0" 写到里面, 然后 运行 composer install 和 composer update 反正能用了

"require": { "php": "^7.2.5", "encore/laravel-admin": "^1.8", "fideloper/proxy": "^4.2", "fruitcake/laravel-cors": "^1.0", "guzzlehttp/guzzle": "^6.3", "intervention/image": "^2.5", "jxlwqq/simditor": "^1.0", "laravel-admin-ext/china-distpicker": "^1.4", "laravel-admin-ext/cropper": "^1.0", "laravel-admin-ext/grid-lightbox": "^1.0", "laravel-admin-ext/helpers": "^1.2", "laravel/framework": "^7.0", "laravel/tinker": "^2.0", "luoyy/ali-oss-storage": "^2.1", "maatwebsite/excel": "^3.1", "nwidart/laravel-modules": "^7.1", "rinvex/countries": "^6.1", "tymon/jwt-auth": "^1.0.0" },

4年前 评论

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