First off you need to set your variable to something like
$var = "hello world";
then you can echo it ie
<?php
$var = "hello world";
echo $var;
?>
second make sure the script is in the servers root directiory.
I.e on apache it is the
htdocs folder
third if that stuff does not fix it I don't know what is wrong lol ๐
Ps here is a good test script
<?php
phpinfo();
?>
this shows your php configuration.