HTTP_HOST and REQUEST_URI must be in quotes, otherwise it throws an error in PHP 7.2
Use:
$actual_link = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
If you want to support both HTTP and HTTPS:
$actual_link = (isset($_SERVER['HTTPS']) ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];