+ 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?

17th Mar 2017, 12:59 AM
Aaron Nyberg
Aaron Nyberg - avatar
4 Respostas
+ 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.
17th Mar 2017, 3:09 AM
Agus Mei
Agus Mei - avatar
+ 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!
17th Mar 2017, 1:49 AM
Dadang NH
Dadang NH - avatar
+ 2
It's easy merge & correct the extension index.html.htm to index.html ,wait at least 15 min , try https to http.
31st Jan 2021, 8:43 AM
ታዲዎስ
+ 1
Try to read apache error log.
17th Mar 2017, 1:07 AM
Ninoslav Jarić
Ninoslav Jarić - avatar