0

I installed latest x64 wamp server : wampserver3.1.0_x64.exe On Windows 7.
I changed it's default 80 port to 8080, because of IIS & now every thing is ok.
I added a simple project to this path : C:\wamp64\www like below :

C:\wamp64\www\php_test\index.php

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Now when i go to this path http://localhost:8080/ > Your Projects Area > php_test > It's link is like this > http://php_test:8080/ > That does not work & is invalid.
The true link is : http://localhost:8080/php_test
How can i fix this problem?
I found the link below for that :
Project Links do not work on Wamp Server
I followed the answer.
Now the new problem is after adding virtual hosts, phptest does not work again.
Here is httpd-vhosts.conf file :

# Virtual Hosts
#
<VirtualHost *:8080>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>


<VirtualHost *:8080>
    ServerName phptest
    DocumentRoot "${INSTALL_DIR}/www/php_test"
    <Directory "${INSTALL_DIR}/www/php_test/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

I did restart all services after adding phptest to virtual hosts.


My questions :
1. How can i fix that invalid link?
2. How make virtual hosts workable?

EDIT After Comments > Here is my HOSTS file content :
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
#
#
SilverLight
  • 19,668
  • 65
  • 192
  • 300

1 Answers1

1

Your HOSTS file is basically empty as a # is a comment.

You have to add a reference to each VHOST into your HOSTS file like this so that the browser can find your development domains

Hosts file

127.0.0.1 localhost
::1       localhost
127.0.0.1 phptest
::1       phptest

Now you must restart the DNS Cache like this, from a command prompt that you have started "As an Administrator" or just reboot the PC

>net stop dnscache

When that has completed do

>net start dnscache

Or there is a menu item on WAMPServers menus

[Right Click] wampmanager-> Tools -> Restart DNS
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149