M
M
Maxim Volkov2020-12-17 13:18:18
PHP
Maxim Volkov, 2020-12-17 13:18:18

Laravel 8 + OpenServer, Composer package installation error, PHP memory_limit parameter limit. How to fix?

Deployed Laravel 8 on local OpenServer (PHP 7.3).

To work with image files, I'm trying to install the Intervention Image package. However, when using the Composer command, I
composer require intervention/image

get an error:


Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://F:/OpenServer/userdata/composer/composer.ph... on line 52


According to the information obtained on the net, the problem is common and easily fixed by making changes to the php.ini file , changing the parameter memory_limit = -1 . By default in OpenServer it is set to memory_limit = 1536M .

However, after making changes to php.ini, changing the parameter memory_limit = -1 and then restarting OpenServer, this file is overwritten and the limit is set again as memory_limit = 1536M .

How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2020-12-17
@voland700

You need to edit configuration templates. They are in the userdata/config folder. They can also be opened from the program menu
5fdb312d84243566977072.png
The second option is to override the parameter from the command line. I do prefer it.
php -d memory_limit=-1 composer.phar <...>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question