I've tested that this works locally, but now that I've moved my content to a godaddy VPS, I'm finding some problems.
I contacted support about it and they told me to research this.
What I have found is that this code:
$finfo = new finfo(FILEINFO_MIME, "../../../../../etc/httpd/conf/magic");
Is pointing to the correct location, but according to support, the webuser does not have access.
What would be the safest way to go about this? I'm relatively new to server management.
EDIT: UPDATE
Only the php.ini file is contained in /etc, which makes /etc/httpd/conf/magic an invalid path for me to use. My local dev machine is Ubuntu Linux. Would I be able to chmod on-the-fly in my PHP code somehow? Thanks in advance.