Wamp, "Your projects" section inaccessible from the homepage

Enzo -  
jordane45 Posted messages 30427 Registration date   Status Moderator Last intervention   -
Hello,

Yesterday, I installed Wamp in order to create a website (up to this point, nothing unusual, you might say).

However, when I click on my project Portfolio that appears in Your projects on the Wamp homepage, it shows that the project is inaccessible. The same result occurs with both Firefox and Chrome, and I just noticed that the issue persists with Internet Explorer. We can conclude that the problem does not come from the browser, already.

However, I would like to point out that if I type localhost (or my IP) in the address bar adding /portfolio (the name of my folder), it works.

So the problem would come from the Wamp configuration.
- I checked my firewall permissions, Apache HTTP Server is indeed included.
- I also looked at some tutorials online, one of them mentioned modifying the index file in the www folder of Wamp, but the line of code to modify is quite different from the example found, so I preferred not to touch it.

I remain at your disposal for any of your responses. Please feel free to be specific though. While I can manage reasonably well with HTML/CSS, PHP and Wamp are still quite nebulous for me.

Thank you in advance.

Configuration: Windows / Firefox 52.0

4 answers

  1. Anonymous user
     
    Otherwise, there is the option to change this without touching the code, by right-clicking on the Wamp icon, then Wamp Settings, and finally clicking on Add localhost to the URL.
    1
  2. Anonymous user
     
    The choice of browser doesn't matter much because this comes from Wamp which has a problem with the links.

    What does the message look like, is it like a 500 or 404 error or a custom page, or even the browser's own page, like when you access a site that doesn't exist?

    Then which link is displayed in Wamp? Because it may not be pointing to localhost/portfolio, you need to check with the developer tools in Firefox/Chrome.
    0
  3. Enzo
     
    Yes, I should have provided more details about the address bar in the error message.

    When my project page does not load, it shows me "Address Not Found" or "This site is unreachable" on Chrome.

    The address bar shows http://portfolio (the name of the folder) on Firefox, portfolio/ on Chrome.

    If additional details are needed, I am ready to provide them, but right now I don't see what else to add.
    0
    1. Anonymous user
       
      It seems that a variable needs to be changed in the index.php of the www folder:

      You need to set $suppress_localhost from true to false.

      But after that, Wamp is increasingly trying to make the creation of virtual hosts easier, which is much more convenient.
      0
      1. Enzo > Anonymous user
         
        The problem is that I only have this line of code that roughly corresponds:

        $suppress_localhost = ($wampConf['urlAddLocalhost'] == 'off' ? true : false);

        On line 33.

        However, I saw a tutorial that said it was a different line, and as I mentioned in my first post, I preferred not to change this current line.

        Should I change this line after all?
        0
  4. Enzo
     
    Indeed, ZeNairolf's last tip to add localhost to the URL works.

    However, it gives me a message:

    "It's a bad idea to add localhost in the launch URLs of projects. It's better to set up VirtualHosts in the file
    wamp/bin/apache/apache2.4.23/conf/extra/httpd-vhosts.conf
    and not to add localhost in the URLs."

    What do I risk? And otherwise, how do I set up the virtual host via the path mentioned above? I admit I'm lost here.

    Finally, if the risks of the previous manipulation are minor, it might be better not to take them into account.
    0
    1. Anonymous user
       
      The risk, personally I don't know it, and I generally used virtual hosts more often for my projects.
      Especially since Wamp helps with the installation of virtual hosts, because now you just have to restart the DNS (if I'm not mistaken), whereas before you had to change the files and even the hosts file manually.

      It's true that a virtual host is better, because for certain projects like using CMS or others, you don't have to worry about changing the site's database, since it will always be the root, and it also avoids the risk of modifying a nearby project due to a bad PHP script.
      0