Add licenses and fix some deprecated calls on PHP+Apache