Activate allow_url_fopen = On in php.ini
Still hazardous. Try Html Purifer http://htmlpurifier.org
https://sebhastian.com/php-filegetcontents-not-working/
$ch = curl_init(); $url = "https://example.com"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); # set cURL to return as a string $output = curl_exec($ch); curl_close($ch);
https://stackoverflow.com/a/75116379
https://stackoverflow.com/a/74813425
https://stackoverflow.com/a/5402193
https://stackoverflow.com/a/71534712
trim + parse https://stackoverflow.com/a/11935969
timeout https://stackoverflow.com/a/59895823
and urlencode the URL https://stackoverflow.com/a/697498
and include User-Agent https://stackoverflow.com/a/45930689
User-Agent + HTTP header, timeout, https://stackoverflow.com/a/77989845
Fail2Ban blocks server doing 'file_get_contents() requests'