It works perfectly on localhost with Xampp, but when I try it on my server (host-ed.net), fopen can\'t open any url, it only works for files without http.
If you are using PHP-FPM, also check the configuration files in pool.d/. PHP-FPM pools can override php settings by using php_admin_flag, php_admin_value, php_flag or php_value. (We encountered this on a Ubuntu 16 vps)