after spending 24-48 hrs on issue, finally got it fixed
Just figured out what went wrong and what’s right when using wamp for “LocalHost”
Ports are important and secondly you should directly go to the menu option of wamp and click on local host
or you can directly type local host on your browser then click on your > Your Projects
What I did wrong was , I was writing my hello world php file and saving in the C/ wamp / www folder which
is proper but for rendering it properly and for opening file i did went directly to C / Wamp / www folder and opened that same document which save directly which is not the way you should open the projects
all you need to do the following things.
type : LocalHost
then click on your : Your Projects tab
and click on the file which you have saved your php in it.
if you got to the directory directly by clicking on C/wamp/www/YourHelloWorld page it won’t render in your browser
for that you need to do the above step