Q:

Can Apache 2.4, PHP be installed and used with elementary OS?

Will Apache2.4, PHP and OpenJDK 8 JRE run well with elementary OS Loki?

A:

They should run fine! These applications all work on Ubuntu. In general, software that works on Ubuntu also work on elementary.
I'm running Apache and PHP in a virtual server using Vagrant, and that setup works well for me. You should be able to run these applications directly on elementary, if you'd prefer.

