php script fails due to '>' character -


i testing php script in kali box, reason keeps failing, , have seen reason ">" character

<?php foreach ($_post $key => $value) {     echo "field ".htmlspecialchars($key)." ".htmlspecialchars($value)."<br>"; }?> 

the result sending post request script is: this

every time write ">" character (even comented) php script terminates if character ">" close tag "?>"

i don't know what's going on, wrote full application in debian 8 box, , works fine; have reinstalled php , apache in kali can't make work in there, running php 7.0.10-1 (cli) ( nts ), insight appreciated.

edit: source code of resultant page is: this

edit: none of solutions in this post works, problem different.

your web server isn't parsing php documents correctly; it's shooting out code if plain html , not interpreting it.

see http://php.net/manual/en/install.php, if using linux distro, there may shortcut instructions make simpler (under ubuntu, example, there shortcuts in https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04). iow, if you're using linux distro, search "php $distroname" simplified instructions.

for it's worth, php interpreter didn't barf on code; appear syntactically ok.


Comments