I have installed XAMPP , there is a htdocs
folder and inside it index.html
file , when I try to open it in my browser through http://localhost/xampp/htdocs/index.html
it says unable to connect to localhost .
what is wrong ?
I have installed XAMPP , there is a htdocs
folder and inside it index.html
file , when I try to open it in my browser through http://localhost/xampp/htdocs/index.html
it says unable to connect to localhost .
what is wrong ?
instead of
http://localhost/xampp/htdocs/index.html
try just
http://localhost/index.html
or if index.html is saved in a folder in htdocs then
http://localhost/<folder-name>/index.html
htdocs
is your default document-root directory, so you have to use localhost/index.html
to see that html file. In other words, localhost
is mapped to xampp/htdocs
, so index.html
is at localhost
itself. You can change the location of document root by modifying httpd.conf
and restarting the server.
Start your XAMPP server by using:
{XAMPP}\xampp-control.exe
{XAMPP}\apache_start.bat
Then you have to use the URI http://localhost/index.html
because htdocs
is the document root of the Apache server.
If you're getting redirected to http://localhost/xampp/*
, then index.php
located in the htdocs
folder is the problem because index.php files have a higher priority than index.html files. You could temporarily rename index.php.
You need to start your Apache Server normally you should have an xampp icon in the info-section from the taskbar, with this tool you can start the apache server as wel as the mysql database (if you need it)
You should simply create your own folder in htdocs and save your .html and .php files in it. An example is create a folder called myNewFolder directly in htdocs. Don't put it in index.html. Then save all your.html and .php files in it like this-> "localhost/myNewFolder/myFilename.html" or "localhost/myNewFolder/myFilename.php" I hope this helps.