Error Composer Out of memory in Laravel

0 votes

By use of Windows, Xampp and php 32-bit version and cloned a laravel Project and it is giving the following error when I run Composer update.

"Out of memory (allocated 1585446912) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220 "

What I have done is

  1. To increase memory size of php.ini to -1
  2. Tried to download php 64 bit and run the following command
"C:\Users\Niroj Dev\Documents\php-7.4.4\php.exe" -d memory_limit=-1 "C:/ProgramData/ComposerSetup/bin/composer.phar" update

The above two way is unsuccessfull

Can someone help me out.? please!

Thank you.

Mar 30, 2020 in Laravel by kartik
• 37,520 points
9,694 views

1 answer to this question.

0 votes

Hey @kartik,

This Error  happens in almost all framework like Magento, Laraval etc. You just need to increase the memory allocation limit in php by php.ini file.

You can do the above task.

Update your php.ini file then restart Apache or your server
example:
memory_limit=128M
to
memory_limit=1128M

Hope this works!

thank you!!

answered Mar 30, 2020 by Niroj
• 82,840 points
i am increse memory 2048m bUt this issue not solve

Depending on your development environment, your number can vary.

I will be using MAMP in this example, but you can also use these steps to help with your Drupal development using Composer.

When you see the following error message, it is very likely that you have a memory limit issue and you need to increase it in the PHP config file.

PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>

To find out what the current memory limit is, run the following command:

php -r "echo ini_get('memory_limit').PHP_EOL;"

After running the command, this is my current memory limit.

128M

Since the memory limit is 128M, it is a good idea to increase it.

To increase the memory limit, we need to locate the PHP config file. We can simply run the following command:

php --ini

Here is an example of what you should expect after running the command.

Configuration File (php.ini) Path: /Applications/MAMP/bin/php/php7.0.8/conf
Loaded Configuration File:         /Applications/MAMP/bin/php/php7.0.8/conf/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

The path to the PHP config file is next to `Loaded Configuration File`.

In your favorite text editor open the php.ini file. Search for memory_limit and increase the value. For instance:

memory_limit = 512M;

After saving the file, we can see our memory has increased.

php -r "echo ini_get('memory_limit').PHP_EOL;"
512M

Hope it helps!!

Thank You!!

Related Questions In Laravel

0 votes
1 answer

What is the use of Facade Pattern in Laravel?

Hey kartik, Facades provide a static interface to classes that are ...READ MORE

answered Mar 19, 2020 in Laravel by Niroj
• 82,840 points
1,618 views
0 votes
1 answer

What is the use of the Eloquent cursor() method in Laravel?

Hello, The cursor method allows us to iterate ...READ MORE

answered Mar 20, 2020 in Laravel by Niroj
• 82,840 points
10,771 views
0 votes
1 answer

What is yield in Laravel and what is the use of yield?

Hii kartik, In Laravel, @yield is principally used to define ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
29,044 views
0 votes
1 answer

Error:login in Laravel. How to solve?

Hey, First check if your model login has a field password in ...READ MORE

answered Mar 26, 2020 in Laravel by Niroj
• 82,840 points
7,726 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
23,019 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
2,999 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
2,922 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,840 points
44,737 views
0 votes
1 answer

Explain the concept of encryption and decryption in Laravel?

It is a process of transforming any ...READ MORE

answered Mar 17, 2020 in Laravel by Niroj
• 82,840 points
1,331 views
0 votes
1 answer

What is the concept of controller in Laravel?

Hii, In the MVC framework, the letter ‘C’ ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,840 points
1,262 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP