Add better version checking to php source compilation. Remove libevent for newer PHP versions.