Add check for allow_url_fopen then CURL fallback

Add a check to see if allow_url_fopen is enabled then fallback to CURL if available.