I have recently installed wampserver 2.0 and configured it to work on port 81. Now the problem is that when I click on phpMyAdmin present at the taskbar inside wampserver 2.0 the browser redirects me to
localhost/phpmyadmin instead of localhost:81/phpmyadmin. When I manually type it, everything works fine.
How can I fix this thing? I want the browser to open localhost:81/phpmyadmin page instead of localhost/phpmyadmin when I click on phpMyAdmin.
The configuration is stored in wampmanager.ini, located in the wamp installation directory.
This file is generated from wampmanager.tpl though, so you need to change the following line there:
Type: item; Caption: "${w_phpmyadmin}"; Action: run; FileName: "${c_navigator}"; Parameters: "http://localhost/phpmyadmin/"; Glyph: 5
You can even add your own menu items in there if you like.
You need to restart Wamp after changing this configuration, since wampmanager.ini needs to be re-generated.
If I'm understanding you correctly, the problem is that your link to phpMyAdmin points to the wrong direction. Now I've never used this server, but the wampserver's taskbar is probably some HTML file. Just look for something like <a href="http://localhost/phpMyAdmin/"> and replace the HREF with your path there.
Wherever possible, you should use relative links in your website. I don't know anything about this "wampserver", but the link to phpmyadmin, instead of being <a href="http://localhost/phpmyadmin">, should be <a href="/phpmyadmin">, and that way it will continue to work no matter what port or domain you're running on.
Added :8080 to all 3 http://localhost uses in wampmanager.tpl. Saved changes. Exited wampserver. Started Wampserver. Came up green. Clicked localhost inside wampserver menu. Wampserver page opened in browser.
Thank you Peter Lang for your post. It led me to solution I've struggled with for several days.
Related
I found a quirk in WampServer that cost me several hours to figure out. I thought I'd share in case anyone else was having the same difficulty:
I updated my MS Visual C++ package, installed the correct version of Wampserver, put my files in the "www" folder, etc. The server was green and running, but my PHP code would not execute.
One thing was my mistake. I thought I could use the browser to access the file, but I learned that you have to go through LocalHost to open the file.
Another was a weird quirk. Watching videos on the internet, I saw others simply go to LocalHost and click on their project in "My Projects" and their webpages came up. For me, I kept getting "File not found". Scrutinizing the address bars in the videos, I realized that when people in the video clicked, the address would read "localhost/test/test.php" (adding the name of the folder and file to the address) but for me, the address would just read "test.php" (without the localhost, etc. at the beginning) Adding it in manually, the webpage finally came up in PHP.
Hopefully this helps someone else. I don't know if I'm doing something wrong, but at least I can find my files!
(Windows 10 / x64)
I also faced this type of error every time I had to type url to run php file or project. Finally, I found it in:
WWW folder in wamp which is there in C drive
In that index.php file there was a problem:
one simple problem was on line number 335 or 338 maybe it will be just http://
make http:// to http://localhost/
Then it worked fine for me.
I had the same issue. My fix was, I disabled my anti virus and then restarted All my wamp services this
When I click localhost in the WAMP menu, the localhost homepage opens as normal. I then click on any of my projects and instead of activating the localhost URL it goes to the server (www) based URL. For instance, one of the projects is 'chrispowell100.co.uk' and I would expect the URL that opens to be localhost/chrispowell100.co.uk but it is actually chrispowell100.co.uk which activates the www version. This has only just started happening in the last few days - prior to that I have used WAMP without issue for several years. I thought at first this may be a W10 problem which is where I first noticed it but I have identical symptoms on W8. (If I type 'localhost/chrispowell100.co.uk' in the address bar, the correct, local version opens.)
Can someone tell me what is happening and how to fix it?
Appreciate any advice!
On looking at the code for WAMP's index.php I came across $suppress_localhost variable. Googling that led me to WAMP - Remove localhost from project URL which answers my question. Case closed.
I'm working with Firefox, but I'm sure answers for all browsers could be useful. When my browser can't find localhost:8000, it tries www.localhost.com:8000. I don't want it to ever do that because then I have to retype localhost.
Type about:config in the browser bar.
Type browser.fixup.alternate.enabled in the search box that appears.
Right click on the browser.fixup.alternate.enabled that appears in the filtered list below and choose Toggle to set the value to false.
Answering my own quesiton, I found a solution to the problem. You can simply set your hosts file to redirect www.localhost.com to 127.0.0.1. On Mac the hosts file is /etc/hosts. There is a similar file for Windows, and probably Unix/Linux as well. You can add this line to the file:
127.0.0.1 www.localhost.com
When i go to localhost (Wampserver index page) and click on one of the project the url goes to 'project-name/' instead of 'localhost/project-name'
Also, some projects open correctly when i directly go to 'localhost/project-name' and some don't (Internal Server Error). Where is the catch?
I have new pc (win 8.1) and I have just installed the newest version of Wampserver.
found a solution,
Open Your Favorite Text Editor.
Open the file located at c:/wamp/www/index.php
Find line that says
$suppress_localhost = true;
Change the line to:
$suppress_localhost = false;
Save the file and refresh localhost and your project links will now work.
Dont forget to +1 me if it works!
Cheers
I am eager to know why localhost.com (without www) redirects to google.com. I also noticed that www.localhost.com gives a 404 page not found. I checked this in Firefox, Chrome and Internet Explorer all does the same. I checked the domain name records and it shows it belongs to Tucows and I am pretty sure Google doesn't own it and I know we can use http redirect to change it to a www or non-www version as the site owner wishes.
Interesting answer posted by Ken Watford, Google employee: http://www.quora.com/Why-does-http-localhost-com-redirect-to-Google
He claims someone bought the domain when the web was still young and kept it ever since, but he does not say who.
It looks like others have had the results as you, check out the links below.
Try here:
http://answers.yahoo.com/question/index?qid=20111105050333AATP1r5
or here:
http://forums.phpfreaks.com/topic/146474-localhost-redirects-to-googlecom/
I think localhost.com should be owned by google as I tried pinging it and it showed the ip of google.com.I still don't know why the DNS records shows tucows as the owner.
I have been searching this from long and finally i found complete solution after going through different answers.
As far as #pradeep's answer is concern, he is right that localhost.com is purchased and points to particular IP so it is redirecting.
But we can override domain names in Windows platform for our local development PC via hosts file residing in C:\Windows\System32\drivers\etc as per #Faysal's answer.
Open hosts file as administrator and enter following line
127.0.0.1 localhost.com
But doing such also did not solve my problem. So i found final solution which will work in chrome browser.
In chrome you have to clear all dns cache via opening following url
chrome://net-internals/#dns
And here clear all cache and finally you will be redirect localhost.com to your local server's home page.
If you are using the Windows platform, then go to your %windir%\System32\drivers\etc and copy the host file to %userprofile%\Desktop. Open it with any text editor and remove the # sign from the front of 127.0.0.1 localhost. Save it and paste it back. Check if the problem is solved.
localhost.com is a website. It does not point to your local IP, instead it most likely has an A record pointing to Google's IP. It practically is Google, and I can prove it.
When the site worked if you connected using HTTPS then it would give a certificate error, the reason being that the certificate is signed to google.com but localhost.com is connecting.
I think the site has now been removed though.... I hope that solves it. It can cause some confusion since localhost points to 127.0.0.1.