Bijesh Shrestha
Bijesh Shrestha

Reputation: 371

Running out of memory PHP Laravel 5.6

I have Laravel project running in Ubuntu 16.04. I migrate it to mac OS Mojave and it running out of memory. Both has identical memory_limit = 128M. Composer install everything correctly but the times out when post-autoload-dump i.e. php artisan package:discover.
NOTE: Works perfectly in Ubuntu.
So, what's the problem behind it?

Upvotes: 1

Views: 669

Answers (2)

Bijesh Shrestha
Bijesh Shrestha

Reputation: 371

The problem was with DB connection, i used mysql 5.7 in Ubuntu and mysql 8 in mac OS. I fixed the problem by adding

'modes'  => [
            'ONLY_FULL_GROUP_BY',
            'STRICT_TRANS_TABLES',
            'NO_ZERO_IN_DATE',
            'NO_ZERO_DATE',
            'ERROR_FOR_DIVISION_BY_ZERO',
            'NO_ENGINE_SUBSTITUTION',
        ] 

in database.php

Upvotes: 0

farooq
farooq

Reputation: 1673

At the present moment there is a bug on Composer causing memory to be exhausted.

If you do

composer install

Then delete a folder inside vendor

rm -rf vendor/laravel

and do

composer update

You'll get this error. It's a bug, it is not supposed to run out of memory.

For now you can fix it for yourself by doing:

php -d memory_limit=-1 /usr/local/bin/composer update

Also, check this thread, they are about to fix this.

Upvotes: 2

Related Questions