You might want to double-check your php version. I have php7.0 as the bundled version in my Ubuntu 16.04 installs. IIRC, PHP5 has been deprecated/left-for-dead
Also, this suggests you're running out of RAM:
apache2 invoked oom-killer: gfp_mask=0x24201ca, order=0,
Possibly add more RAM, disk swap, or at least a swap file and see if ...