Link in "Your Projects" isn't working in WAMP server

30,541

Solution 1

I believe this is the best and easiest solution:

Open index.php in www folder and set

change line 30:$suppress_localhost = true;

to $suppress_localhost = false;

This will ensure the project is prefixed with your local host IP/name

Solution 2

Just change the value in wamp/www/index.php line no 338.

Change this :

From

$projectContents .= '<li><a href="'.($suppress_localhost ? 'http://' : '').$file.'">'.$file.'</a></li>';

to

$projectContents .= '<li><a href="'.($suppress_localhost ? 'http://localhost/' : '').$file.'">'.$file.'</a></li>';

Solution 3

Run the wamp server, Start apachee and enter the url as

http://localhost/websites/index.php
Share:
30,541
Sani Evans
Author by

Sani Evans

Updated on July 09, 2022

Comments

  • Sani Evans
    Sani Evans almost 2 years

    I'm on windows 8, I downloaded the wamp server and I have my index.php saved into the "www" folder within a subfolder called websites. When I'm on the localhost page, it displays the subfolder under "Your Projects" but when I click it, it takes me here

    http://www.dnsrsearch.com/index.php?origURL=http%3A//websites/&r=http%3A//localhost/

    and it says

    "Why Am I Here? You entered an unknown web address that was used to present site suggestions that you may find useful. Clicking any of these suggestions provides you with search results, which may include relevant sponsored links.

    If this service is not right for you, please visit your Preferences page to opt out. At any point in time, you can opt back in to the service by visiting your Preferences page.

    If you have other questions about this service, please visit our FAQ."

    Basically, it's taking me to a search engine and trying to show some suggestions for what I could've wanted, but I'm not trying to go to a website. I'm trying to access and display my test site so I can start practicing PHP. It's been really frustrating just getting started with this because I've come across all these different ways to do php and different problems and so far, using this wampserver seems like the best option but I'm stuck. Please please please help. This is driving me nuts!

    Summary: I installed the WAMP server, I have my index.php saved in my www folder with its designated www subfolder (wamp\www\Websites\index.php), it displays on the localhost under my projects, but the link to display it doesn't work.

    Any answers?

    FOLLOWING UP A YEAR LATER

    I appreciate the responses I've received. What I ended up doing to get the ball rolling (I went on a web development hiatus to pursue other things) and make things a lot easier to work with is I setup a LAMP server instead and it made the install process super easy and straight forward, and from there I've had no problems at all creating virtual hosts and making my websites work and having everything interact the way it should. If you're stuck where I was, setting up and using WAMP on windows is a lot more involved and touchy than setting it up on a linux system. On a linux system, you won't get a dedicated gui program like WAMP, but you'll have everything running in your operating system to handle it and it basically turns your computer into a local web server with php/sql support, and whatever else you'd like to add onto it. I'm using kali linux and it's working out fine for me. If you just want to dive into php without having to get over the huge hurdle on windows virtual hosts, I highly recommend just doing the research and setting it up on a linux system. If you have an additional hard drive, put linux on it. If you don't, setup a dual boot configuration on your drive so you'll have windows and linux. It helped me out a ton with learning how to make things on the backend reference each other the way I wanted to while also getting a significantly better understanding of it as I went. All you need installed is apache, mysql, and php and after setting everything up, it should work just fine on your local machine. Learning linux can seem scary at first, but this process is a lot more straight forward and easier to understand than doing it on windows.

  • Sani Evans
    Sani Evans over 9 years
    Thank you for the response! I actually figured this out later on that day, but you are 100% right. I don't know why I didn't think to do that originally. But hey, you live and learn haha.
  • manitaz
    manitaz over 9 years
    Ok take it easy..........
  • Anuj Garg
    Anuj Garg almost 9 years
    Perfect, worked for me. Thank you.
  • Bonatti
    Bonatti almost 9 years
    While this will work, it should be unadvised, since your code will fail when run outside of the local machine. Also, the Virtual hosts method could teach on how the DNS would work on the production enviromment.