Error 404 | Sololearn: Learn to code for FREE!

+1

Error 404

So today I got started using PHP and the course tells me this: "Save it as someFile.php in the Apache root folder (In Windows, it is usually the folder C:\xampp\htdocs). Now, open your web browser and go to http://localhost/someFile.php" well I put the example code into N++ and save it to the given destination. I then type in http://localhost/someFile.php into chrome and I get this error: This localhost page can’t be found "No webpage was found for the web address: http://localhost/someFile.php Search Google for localhost someFile HTTP ERROR 404" what am I doing wrong?

php

3/17/2017 12:59:52 AM

Aaron Nyberg

4 Answers

New Answer

+9

have you start apache service in xampp control panel? test apache service by typing localhost on web address. if there is xampp page then its already running. if not, find xampp control panel in c:\xampp.

+4

Try to access it by using this url http://127.0.0.1/somefile.php It may caused by: 1. Your browser didn't know who is localhost, so it try to looking up on the internet/wrong address. To solve this, make sure on your hosts file ( windows = C:\WIndows\System32\drivers\etc , linux/mac = /etc/hosts ), there are localhost address pointed to your server IP. 2. There are a wrong on configuration either on the Apache configuration, or on the virtual host configuration. You can check on the apache error log and access log, make sure that localhost/somefile.php pointed to your php location. Good luck!

+2

It's easy merge & correct the extension index.html.htm to index.html ,wait at least 15 min , try https to http.

+1

Try to read apache error log.