简体   繁体   English

Laravel 安装程序用完 Memory

[英]Laravel Installer Running Out of Memory

I have gotten composer to work on my laptop a while back, but I'm getting very stuck with getting it installed on my main computer.不久前,我让作曲家在我的笔记本电脑上工作,但我非常坚持将它安装在我的主计算机上。 I have downloaded the latest version of Composer (1.10.8) and am using Cygwin on a Windows machine.我已经下载了最新版本的 Composer (1.10.8) 并在 Windows 机器上使用 Cygwin。 The problem comes with running "composer global require laravel/installer" in that it keeps running out of memory.运行“composer global require laravel/installer”时出现问题,因为它一直用完 memory。 I have the PHP memory limit currently set at 8GB (which should be way more than enough) and yet it keeps saying it's running out of memory at the exact same place as it did with my memory limit at 128M, or 1024M, or 2048M: I have even tried the following command and got the following result: I have the PHP memory limit currently set at 8GB (which should be way more than enough) and yet it keeps saying it's running out of memory at the exact same place as it did with my memory limit at 128M, or 1024M, or 2048M:我什至尝试了以下命令并得到以下结果:

$ php -d memory_limit=-1 /usr/local/bin/composer global require laravel/installer
Changed current directory to /home/User/.composer

PHP Fatal error:  Out of memory (allocated 38273024) (tried to allocate 2102411 bytes) in phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php on line 462

Fatal error: Out of memory (allocated 38273024) (tried to allocate 2102411 bytes) in phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php on line 462

I am unsure what to do now because everywhere online keeps telling me to increase my memory limit but even with no memory limit, the output is the same.我不确定现在该怎么做,因为网上到处都在告诉我增加我的 memory 限制,但即使没有 memory 限制,output 也是一样的。 What should I do?我应该怎么办?

Try to use x64 version of PHP.尝试使用 x64 版本的 PHP。

To run composer using a local copy of PHP x64 you can do the following:要使用 PHP x64 的本地副本运行 composer,您可以执行以下操作:

Download the zip file from here (VC15 x64 Thread Safe version): https://windows.php.net/download Unzip the file Copy php.ini-development and rename to php.ini Uncomment the extension_dir = "ext" line and any other php extensions you will need (such as extension=gd2 or extension=openssl). Download the zip file from here (VC15 x64 Thread Safe version): https://windows.php.net/download Unzip the file Copy php.ini-development and rename to php.ini Uncomment the extension_dir = "ext" line and any您将需要的其他 php 扩展(例如 extension=gd2 或 extension=openssl)。 If any other PHP extensions are needed for the update then it will tell you while running the command.如果更新需要任何其他 PHP 扩展,那么它会在运行命令时告诉您。 Working command:工作命令:

"C:\path\to\php-7.2.23-Win32-VC15-x64\php.exe" -d memory_limit=-1 "C:/path/to/composer.phar" update

Source: https://ourcodeworld.com/articles/read/816/how-to-solve-composer-install-update-error-virtualalloc-failed-0x00000008来源: https://ourcodeworld.com/articles/read/816/how-to-solve-composer-install-update-error-virtualalloc-failed-0x00000008

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM