1

when I installing guzzlehttp/guzzle on amazon ec2 in laravel 5.8 application.

I got the issue of:

"The following exception is caused by a lack of memory and not having swap configured"

This is the error:

PHP Fatal error:  Uncaught ErrorException: proc_open(): fork failed - Cannot allocate memory in /usr/share/php/Symfony/Component/Console/Application.php:943
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', '/usr/share/php/...', 943, Array)
#1 /usr/share/php/Symfony/Component/Console/Application.php(943): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 /usr/share/php/Symfony/Component/Console/Application.php(751): Symfony\Component\Console\Application->getSttyColumns()
#3 /usr/share/php/Symfony/Component/Console/Application.php(712): Symfony\Component\Console\Application->getTerminalDimensions()
#4 /usr/share/php/Symfony/Component/Console/Application.php(645): Symfony\Component\Console\Application->getTerminalWidth()
#5 /usr/share/php/Symfony/Component/Console/Application.php(127): Symfony\Component\Console\Application->renderException(Object(ErrorException), Object(Symfony\Component\Console\Output\StreamOutput))
#6 /usr/share/php/Composer/Console/Application.ph in /usr/share/php/Symfony/Component/Console/Application.php on line 943

when I ran "free -m" I got below result

enter image description here

Niraj Savaliya
  • 179
  • 1
  • 14
  • What are the specs of the machine you're running it on? How much ram is actually free when executing? – Jesse Schokker Sep 12 '19 at 07:13
  • Possible duplicate of [PHP Composer update "cannot allocate memory" error (using Laravel 4)](https://stackoverflow.com/questions/18116261/php-composer-update-cannot-allocate-memory-error-using-laravel-4) – Jesse Schokker Sep 12 '19 at 07:25
  • @JesseSchokker I tried same solution but didn't work, when I ran "/sbin/swapon /var/swap.1" it's asking for permission 644 to 600 and I tried to give permission but still now working. – Niraj Savaliya Sep 12 '19 at 07:29

2 Answers2

1

I have same problem too and below is the way useful to me.

put "guzzlehttp/guzzle": "^6.3" into composer.json and then

rm -rf vendor/

rm -rf composer.lock

composer install

after this, everyting is good

Notice: not do this in your product site

Sam lee
  • 13
  • 1
  • 5
-1

To increase the PHP memory limit and upload limit, change these lines in PHP.ini

memory_limit = 256M
upload_max_filesize = 12M
post_max_size = 13M
mukesh kumar
  • 580
  • 3
  • 14