XAMPP v1.7.4 installation issues,local host not working

匿名 (未验证) 提交于 2019-12-03 01:41:02

问题:

I had an older version on XAMPP and it was working fine. I uninstalled it to install the new version.Since then local host has stopped working. XAMPP control panel says Apache and MySQL running.Can some one help please? I have got this in the httpd-vhosts.conf,do i make any changes here?

##<VirtualHost *:80>     ##ServerAdmin postmaster@dummy-host.localhost     ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost"     ##ServerName dummy-host.localhost     ##ServerAlias www.dummy-host.localhost     ##ErrorLog "logs/dummy-host.localhost-error.log"     ##CustomLog "logs/dummy-host.localhost-access.log" combined ##</VirtualHost>  ##<VirtualHost *:80>     ##ServerAdmin postmaster@dummy-host2.localhost     ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost"     ##ServerName dummy-host2.localhost     ##ServerAlias www.dummy-host2.localhost     ##ErrorLog "logs/dummy-host2.localhost-error.log"     ##CustomLog "logs/dummy-host2.localhost-access.log" combined ##</VirtualHost>

Thank You

回答1:

you can also fix it by editing your host file usually located in %systemroot%\system32\drivers\etc\hosts

first of all backup your hosts file

comment this line by adding # at the beginning of the line(if its already their)

#::1 localhost 

add this line in the end of the file

127.0.0.1       localhost

save it and restart your pc

if you face any problem just restore your hosts file



回答2:

As you can access it using 127.0.0.1 and not 'localhost', locate httpd-vhosts.conf, usually in C:/xampp/apache/conf/extra/ and make sure you have the following listed as a virtual host:

  <VirtualHost *>     DocumentRoot "C:\xampp\htdocs"     ServerName localhost   </VirtualHost>

Then restart Apache from the XAMPP control panel.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!