Summer Sale! All accounts are 50% off this week.

David Orizu's avatar

How can I Increase memory limit of Laravel Project

I am trying to start up login and registeration panel using auth , php artisan make:auth wasn't working so I used

composer require laravel/ui

And this was the result

Using version ^3.2 for laravel/ui
./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://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

I later then ran

composer self-update 

which updated successfully but after that, I went back to try

composer require laravel/ui

And it still gave me that memory error. Please guys I seriously need solutions urgently I'm pleading.

0 likes
10 replies
martinbean's avatar

@david orizu What version of Composer are you using? The last few versions of Composer 1.x got really bad for memory management, and don’t think I’ve had any issues with Composer 2.x.

If not already, try updating to Composer 2:

composer self-update --stable

And then run composer --version to check you’re using 2.x. Then try installed laravel/ui again.

If you still get memory issues, you can try this:

COMPOSER_MEMORY_LIMIT=-1 composer require laravel/ui
2 likes
newbie360's avatar

in Homestead i was use

php -d memory_limit=-1 /usr/local/bin/composer require laravel/ui
David Orizu's avatar
David Orizu
OP
Best Answer
Level 1

Thanks guys for your support I ran

composer self-update --2

to upgrade my laravel version to version two then when I ran

composer require laravel/ui

It generated successfully and as I ran

php artisan ui vue --auth

Authentication scaffolding generated successfully. Then I ran

npm install && npm run dev

to compile fresh scaffolding.

Thanks guys so much for your suggestions they were really helpful.

1 like
Tray2's avatar

@michaloravec you can't @-him since it will go to a guy named david and not to OP. I little bugg in the mention functionality.

David Orizu's avatar

Please guys don't be offended it worked for me that's why I marked it. Please I'll still be needed your help friends.

David Orizu's avatar

Ok I'm new here and I didn't know what I did was wrong OK. Please my friends forgive and understand alright?

1 like
shez1983's avatar

someone gave u a reply - which u did, but u gave yourself best answer - thats what you did wrong as have said..

Please or to participate in this conversation.