We are running Ubuntu 16.04 LTS with Apache 2.4 and PHP 7.2. 9 times out of 10, the web app works well, but at a random interval, we come across this error message.
"Allowed memory of 134217728 bytes exhausted(tried to allocate 135168 bytes) in {file} line ..."
We are testing this on a staging server which is only used for a few of us - so the memory/CPU utilisation is a bare minimum.
One thing to note is that we only get this issue when we try to access content from outside the network via these PHP functions
file_get_contents
get_headers
Restarting apache fixes the issue but it comes back again very very randomly - sometimes immediately and other times in 1 day.
We tried increasing the PHP memory limit but that didn't help. This file_get_contents fails even for very very small files.
We have the same setup on our local machines (Win & Mac) and the web app works perfectly fine and we never hit these memory issues.
Any clue what could be going on or where should we look next? Could it be missing Apache Modules?
Thanks for your help in advance!