Laravel Memory Issue?

萝らか妹 提交于 2019-12-13 17:21:57

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/41236908/laravel-memory-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!