Undefined variable in code: if ($_SERVER["SERVER_PORT"] != "80" && strpos($host, ':')

hi, i have some trouble with this code line

if ($_SERVER["SERVER_PORT"] != "80" && strpos($host, ':') === false) {
			$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
		} else {
			$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
		}

i obtain this error message

Notice: Undefined variable: host in /storage/ssd4/455/1458455/public_html/galleries/dwl-wortel/index.php on line 35

Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd4/455/1458455/public_html/galleries/dwl-wortel/index.php:35) in /storage/ssd4/455/1458455/public_html/galleries/dwl-wortel/index.php on line 101

what can i do?
isnt blocked page, just annoying in refreshing

edit1:
i have other galleries with same code and i dont have trouble with them
i check the code its the same

edit2:
oops, maybe its because i modify the htaccess files
like this: php_value display_errors 1

Hey can you check your site after removing the code from .htaccess?

after htaccess deleting
no more errors display (of course)

but for the code, maybe i need to “downgrade” the php version of my website
perhaps new php dont accept this line code

Perhaps add those two lines to your .htaccess

php_flag display_errors on
php_flag output_buffering on