Cannot find localhost

I get a "not found" error from this

localhost/choice.php
ethan@meow:~$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.036 m

and this

ethan@meow:~$ mysql -u root -p*** 
Welcome to the MySQL monitor.  Commands end with ; or \g.

and this

nano /etc/hosts
127.0.0.1  localhost  /var/www
127.0.1.1 WMC.wmcomputersystems  WMC

Totally confused

TIA

localhost is not a command nor is it a valid path.

If you want to execute choice.php use the command /var/www/choice.php , assuming it can be executed.

Thanks-

Why is

localhost

not a valid path? As shown above, I think it maps to

/var/www

Both with localhost/choice.php and /var/www/choice.php I get a 404
Permissions 777

TIA

Please believe jim mcnamara in that localhost is NOT a valid path used to locate executable commands/programs in your directory structure. If found in /etc/hosts , it can be resolved (by the resolver ) if part of a URL.

EDIT:
But then, as a part of a URL, use it correctly, e.g. file://localhost/tmp The /etc/hosts entry does not map but connects IP_address canonical_hostname [aliases...] .

RudiC is right, localhost is NOT a valid path that helps in locating the executables,

Run the complete command,
/var/www/choice.php