Unable to run php files on XAMPP

I’m a beginner and trying to run php file through localhost as per the instructions given in the book PHP & MYSQL NOVICE TO NINJA 5th edition . I’m trying to run the very 1st program fiven in the book through localhost i.e in this way localhost/today.php but it’s not workin. Please do help.

What, precisely, is it doing and not doing? Have you checked the Apache logs for error messages? Are there any error messages in the browser console? Any error messages displaying in the browser screen?

This is the error when I try to open the php file
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19

Hmm. It can’t find the .php file, it seems. Are you sure that the XAMPP server isn’t set to use a particular port? Try localhost:8080/today.php to see if that brings it up. Or check config to see if a port is specified. If you are running with IIS enabled, then IIS takes over the default port 80, I think.

HTH,

Sorry , I tried but i don’t know how to check the config. There is something written in the XAMPP control panel infront of the Apache i.e - port(s) 80,443.
I think this is what u asked me to look after .

Yep… 80 is http and 443 is https (secure), so at least the XAMPP is set correctly; but have you checked to see if IIS is also running? If it is, disable it.

How would I check that If IIs is running

If you try
http://127.0.0.1
instead of
http://localhost

does it then work?

Thanks, I got the solution. I did some mistake previously & found the solution on youtube.

Well done and glad that you found it. Just out of curiosity… what was it?

Actually, I started learning php about 3 months before & had set the password for root user & that was the actual problem where I got stuck.