LocalHost Errors in WampServer 2.5 caused by error in PHP code
Posted by: TheSteven (---.socal.res.rr.com)
Date: June 29, 2014 02:53PM

There are 2 aspects of this issue -
The first is to be able to access items under "Your Projects" from the Wamp localhost homepage.
The second is to be able to correctly access items listed in the Wampserver Icon Taskbar's "My Projects" list.

To fix the first (to be able to access items under "Your Projects" from the Wamp localhost homepage) you will need to do the following...

There are 2 edits that you must make in the index.php file located in your wamp\www folder (usually C:\wamp\www)

1) on Line 30 change
$suppress_localhost = true;
to
$suppress_localhost = false;

2) on line 338 change
$projectContents .= '<li><a href="'.($suppress_localhost ? 'http://' : '').$file.'">'.$file.'</a></li>';
to
$projectContents .= '<li><a href="'.($suppress_localhost ? 'http://' : 'http://localhost//').$file.'">'.$file.'</a></li>';

After you've made the above edits - if the Wampserver is running just refresh the local host page and the changes become immediately effective.

To fix the 2nd item (the Wampserver Icon Taskbar's "My Projects" list): You need to edit C:\wamp\scripts\refresh.php

Locate line 651 and change the section of the line that reads
//'.$projectContents[$i].'/"; Glyph: 5
to
//localhost//'.$projectContents[$i].'/"; Glyph: 5
Note: I had to minimize the code because above because forum board thought I was posting a link and altered it.

After you make these 2nd set of changes you may have to force Wampserver to refresh the "My Projects" list by toggling the Put Online/Offline option at the bottom of the Wamp Icon Tray App.

Options: ReplyQuote
Re: LocalHost Errors in WampServer 2.5 caused by error in PHP code
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: June 30, 2014 01:16AM

Please see the bottom of this post for the correct solution.

WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts


Can I emphasise that Virtual Host definitions for all your projects is still the only CORRECT way to develop sites without risking problems later when moving developed sites to a live server!

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: LocalHost Errors in WampServer 2.5 caused by error in PHP code
Posted by: TheSteven (---.socal.res.rr.com)
Date: June 30, 2014 02:22AM

Thanks for the link, took a few minutes to scan it over.
I will seriously check it out in depth when I can spare a couple of hours.

First impression:
For my 'serious' projects (commissioned, large, legacy or otherwise) Virtual Hosts seems ideal.
Look forward to testing it out.

For my exploratory and demo projects it seems like needless work and overkill.
Most of these project tend to either be temporary or rarely accessed once completed (kept for reference).


Once I get a chance to beat on Virtual Hosts I may end up setting everything with that strategy/implementation in mind or working out a hybrid approach that keeps my hacks but still supports Virtual Hosts.

Options: ReplyQuote
Re: LocalHost Errors in WampServer 2.5 caused by error in PHP code
Posted by: Otomatic (Moderator)
Date: June 30, 2014 02:56PM

Hi,

> For my exploratory and demo projects it seems like needless work and overkill.
It is much simpler and less time consuming to use the VirtualHost than trying to run a project properly without them.
Add a VirtualHost for a new project, it's less than two minutes.
In addition, it is in this way that work almost all hosters.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.