Improve PHP 8 compatibility
Summary:
Mainly array key issues, at several places keys were used
with the expectation it returns null if the key doesn't exist.
HTTP_HOST can contains only the host, without port.
Side edit: update fortunes path for FreeBSD 12+
Test Plan: Tested on https://tools51.nasqueron.org tool by tool
Reviewers: dereckson
Reviewed By: dereckson
Differential Revision: https://devcentral.nasqueron.org/D2483