As you got for
ls -ld /var/www/html the output
drwxrw-rw- 2 root root 4096 Sep 25 11:49 /var/www/html
that means you have a directory (
d) which is readable and writeable by everybody (
rw), but only searchable (
x) by root. So it's not a binary file. I don't know which program you were using that shows folder icons and properties, but whatever it is, it is wrong.
This came about because you set the permissions of this directory and all its parent-directories to
766 (which is octal for
rwxrw-rw-). At least in case of
/var, this is totally wrong, because it will deny search rights to all non-root parts of the system, and this may break things.
The lesson you should learn from this is don't blindly follow some recipes you found on the internet without understanding what you are doing.
So your first task is to read
man chmod (all of it) and understand file permissions, and how they differ for files and directories. If this is not enough, google for explanations until you understood it.
Your next task is to fix the permissions of
/var/www/html to something that makes sense (depending on your needs). For this you need to answer the question "who should be able to read/write/search those directories". In case of
/var, you should arrive at something like
755. If you don't, think again.
And finally, you should execute again
chown pi /var/www/html to change the owner of this directory from user
root to user
pi, because it didn't work. You can use
ls -d to verify if it worked. And while you are at it, think about which group it should belong to (which groups does the user
pi belong to?). Read
man chown and