WAMP project links won't resolve to localhost
Posted by: eamonn (78.16.127.---)
Date: May 22, 2014 07:36PM

Hi guys,

I have a fresh install of WAMP on a new Win8 PC. Specs are as follows:

WAMP v.2.5
Including:
Apache 2.4.9
PHP 5.5.12
MySQL 5.6.17

My hosts file refers to localhost as: 127.0.0.1 localhost

No virtual hosts are setup.
IIS is listening on port 80, so my httpd.conf file listens on port 8080.

My project directory is named 'eoy' and sits in the E:\wamp\www directory.

When I click on the 'eoy' link on the WAMP homepage, the browser attempts to load [eoy], which obviously fails. I see this problem mentioned before, with the brief reply 'use VirtualHost'. I do not see documentation for configuring a virtualhost, and the 'trainings' tab loads the main site again, but in French. I have the same setup (slightly earlier version numbers) on my Win7 laptop and it worked out of the box without Virtualhost. I'm hoping the same can be achieved here.

I have tried changing the httpd.conf file to listen on 8080, :8080, 0.0.0.0:8080, and 127.0.0.1:8080 but it has not made any difference.

Any help or advice appreciated.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Otomatic (Moderator)
Date: May 22, 2014 07:56PM

Hi,

Cette url n'est pas en Français - This url is not in French : [forum.wampserver.com]

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.1/7.1.13/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.1/7.1.13/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
PhPMyAdmin 4.7.7 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: eamonn (78.16.127.---)
Date: May 22, 2014 08:01PM

Merci - Thank you. I'll give it a shot.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: KevinV (190.85.178.---)
Date: May 22, 2014 09:31PM

apparently there are only 2 solutions to this, look at my question.

[forum.wampserver.com]

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Otomatic (Moderator)
Date: May 22, 2014 10:06PM

Hi,

Not use VirtualHost is definitely the wrong solution.

For example, wampserver.com is hosted by Gandi and you do not call (http://gandi/wampserver.com); well, in the same way, your projects are hosted by localhost and you should not add an additional level in the url, if you do it, variables like $ _SERVER [...] will not have the right values​​.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.1/7.1.13/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.1/7.1.13/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
PhPMyAdmin 4.7.7 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: timweber (---.hfc.comcastbusiness.net)
Date: May 22, 2014 11:13PM

eamonn describes the problem I'm experiencing. It looks like the system is not including localhost/ when writing to wampmanager.ini. It writes this, for example :


[myProjectsMenu]
;WAMPPROJECTMENUSTART
Type: item; Caption: "test"; Action: run; FileName: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"; Parameters: "[test];; Glyph: 5
Type: item; Caption: "videodb"; Action: run; FileName: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"; Parameters: "[videodb];; Glyph: 5

instead of this:

[myProjectsMenu]
;WAMPPROJECTMENUSTART
Type: item; Caption: "test"; Action: run; FileName: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"; Parameters: "[localhost];; Glyph: 5
Type: item; Caption: "videodb"; Action: run; FileName: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"; Parameters: "[localhost];; Glyph: 5

If the code that updates the My Projects list, wherever it is, would just append 'localhost/' after [], the links would work.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: timweber (---.hfc.comcastbusiness.net)
Date: May 22, 2014 11:16PM

The sample code got mangled. I'll try again. Parameters should be http etc. followed by localhost/ and then the project directory - say, test/. The localhost/ bit is not being written when the .ini file is updated.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Otomatic (Moderator)
Date: May 23, 2014 11:26AM

Hello,

Tonight, I'll post an edit procedure to add 'localhost' (or not) in the url of the projects

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.1/7.1.13/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.1/7.1.13/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
PhPMyAdmin 4.7.7 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: corbinkol (24.213.115.---)
Date: June 05, 2014 12:50AM

Hello,

Not sure if you have found the solution yet, but I was having the same problem with my new install of WAMP. I was able to fix it by editing a line in the default "index.php" file in the root folder.

Try searching the index.php file for:

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

and replace it with:

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

That should fix your issue.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: RiggsFolly (---.as13285.net)
Date: June 05, 2014 09:41AM

That is NOT THE SOLUTION.

Create VIRTUAL HOSTS for each of your projects. That is now and ALWAYS HAS BEEn the correct solution.

Here is how to do it

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.1.1 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.7.7> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Dimi2014 (---.on2.ontelecoms.gr)
Date: October 26, 2014 08:28AM

corbinkol, thanks for this solution. While creating virtual hosts may be the correct way to do it it's too time consuming plus you need command lines to open and save the hosts file, Windows won't let you do it just by clicking on it.

There are times when I need as many as 5 different versions of a site I'm working on and if I had to go through that whole process of creating virtual hosts for each one, well, it wouldn't be worth it. I work w/Joomla exclusively and never had any issues transferring my site to a live server.



Edited 1 time(s). Last edit at 10/26/2014 08:29AM by Dimi2014.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Nige M (---.7-4.cable.virginm.net)
Date: October 27, 2014 11:41PM

There is clearly a problem here.

I have just installed a new WAMP installation on a new Windows 8 machine and have the same difficulty. My old installation on my XP machine DOES NOT NEED VIRTUAL HOSTS (RiggsFolly -no need to shout smiling smiley . I would also point out that a virgin empty loacal host page on a clean install displays the message:-

Your Projects
No projects yet.
To create a new one, just create a directory in 'www'.

No mention of virtual hosts.

I have to agree with Dimi14 and will use his solution unless I'm told that it will cause other problems or a fix is issued.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Nige M (---.7-4.cable.virginm.net)
Date: October 28, 2014 08:12PM

WAMP projects menu fix.

I have generated what I think is a fix for this problem.

The wampmanager.ini file in wamp root holds the [myProjectsMenu] paths in the Parameters variables. The localhost/ is not present in the path.

That project list in wampmanager.ini is dynamically created, extracted from reading the names of the project folders you create in www.

The list in the wampmanager.ini file is generated by the script refresh.php file, located in the wamp/scripts folder.

The following edit worked for me.

First, save a copy of your existing refresh.php file; to restore to in case of problems.

Search in the refresh.php script for $projectContents (around line 651 if you are using an editor with line numbering).

Update the last line below (existing) with the three below, using all three of these lines:-

651 //update by Nige M to add localhost/ to the Parameters: path value - the original line commented out and the amended line is below it
652 //$myreplacesubmenuProjects .= 'Type: item; Caption: "'.$projectContents[$i].'"; Action: run; FileName: "'.$c_navigator.'"; Parameters: "['.$projectContents][$i].'/"; Glyph: 5
653 $myreplacesubmenuProjects .= 'Type: item; Caption: "'.$projectContents[$i].'"; Action: run; FileName: "'.$c_navigator.'"; Parameters: "[localhost][$i].'/"; Glyph: 5

So, I have replaced my existing line 651 with three lines. I'm guessing that your line numbers may differ a little from mine but I don't know.

You can refresh your wampmanager.ini file by right clicking your tray icon and clicking Refresh. Or exit then restart Wamp.
You should then be able to open your projects by clicking them in the Wamp icon My Projects menu!
Your wampmanager.ini file will now have localhost/ appended to the http:// part of the Parameter.


Please add your feedback here if you have tried this fix.

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Nige M (---.7-4.cable.virginm.net)
Date: October 28, 2014 10:02PM

By the way. My fix above is for the My Projects menu accessed by left clicking the system tray Wamp icon.

The solution from corbinkol (thanks) above is for the links on the Localhost page accessed by left clicking the system tray Wamp icon. I would suggest modifying your solution corbinkol to simplify it a little. Just modify line30 in index.php to read:

$suppress_localhost = false; //$suppress_localhost = true;

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 28, 2014 10:37PM

The fix is in this post [forum.wampserver.com] and has been for Months

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.1.1 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.7.7> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: Nige M (---.7-4.cable.virginm.net)
Date: October 28, 2014 11:05PM

Thank you RiggsFolly. That was a much more useful link than the one you indicated earlier in this thread. It resolves the problem of an install that has broken links on the Localhost page and in the My Projects menu as it comes out of the box. Will it be many more Months before they are fixed?

Options: ReplyQuote
Re: WAMP project links won't resolve to localhost
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: October 29, 2014 01:12AM

The next release has fixes for all these issues, and lots of great new features, but I have no idea when the next release will be I am afraid.

---------------------------------------------------------------------------------------------
(Windows 7 Pro 32bit) (Wampserver 3.1.1 32bit)
<Apache 2.4.23/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.17/5.5.28>
<MariaDB 10.1.21> <phpMyAdmin4.7.7> <MySQL Workbench 6.3.6.511>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote


Sorry, only registered users may post in this forum.