Laravel Memory Issue?

1.9k Views Asked by At

enter image description here

dear all

i am facing such problem on DO server, i have tried everything , the whole site is working 100% properly on linux server using Homestead but after uploading it , it works for one time , going down many times after reloading or refreshing the page . - i tried to increase the memory of the apache server - i also tried to track the laravel.log but no any issues. - i also deleted the compiled.php in addition of composer clear-cache + php artisan cache:clear + php artisan optimize but no use.

any ideas ? i would be so thankful. thank you in advance.

2

There are 2 best solutions below

0
On

Your droplet is running out of memory. Create a swap file to fix this issue.

sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Reference: DigitalOcean

0
On

this is the answer of my question if anyone may encounter this in future.

the server was having some other wordpress sites that was made from the main github repo which does not include the .htaccess , that was somehow consuming server memory.

1- create a .htaccess for each wordpress. 2- add php.ini within each (folder) site with memory_limit 64M or whatever number u would like to use. thank you for ur concern.