Menu

Laravel / PHP Error: Allowed memory size of 134217728 bytes exhausted – Easy Fix

Allowed memory size of 134217728 bytes exhausted – Easy Fix

Allowed memory size of 134217728 bytes exhausted – Easy Fix

Simple & Fast Solution
Agar aap Apache + .htaccess use kar rahe ho, toh:
Apni .htaccess file open karo
Sabse upar yeh line add karo

php_value memory_limit 1024M


Example (Final .htaccess top)

php_value memory_limit 1024M

<IfModule mod_rewrite.c>

    RewriteEngine On

    ...

</IfModule>



Check Karne Ke Liye

Terminal me run karo:

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

Example:

[host-name@vps public_html]$ php -r "echo ini_get('memory_limit');"

1024M



Other Solution:
Project root ya public_html me ek file banao: .user.ini
Add karo:

memory_limit = 1024M

Save karo, fir kuch seconds wait karo (PHP automatically read karta hai).
Verify karo:
php -r "echo ini_get('memory_limit');"
output : 1024M
Flow-chart laravel

Contact