Can not connect to wordpress in localhost (GET http://localhost/ net::ERR_CONNECTION_REFUSED)
Asked Answered
D

2

5

I just backup wordpress DB and public_html folder in virtual-web-hosting.

And I move them to my local MAMP.

But when I enter http://localhost:8888/, it just transfer to http://localhost.

And the error message (GET http://localhost/ net::ERR_CONNECTION_REFUSED) shows in chrome.

Could some one give me some hint?

I had tried to put a dummy index.php with echo "debug" in /htdoc/test

and then connected to http://localhost:8888/test, it shows "debug" just as expected.

Thanks.

Dahl answered 15/1, 2015 at 15:20 Comment(1)
get http://localhost implies you're running a proxy, and telling the proxy to fetch an "external" url. a normal non-proxied http request would be GET /Kept
B
13

Change the site url and home url on your Wordpress database.

On your phpMyAdmin (should be http://localhost/phpmyadmin)

Go to your options table, search the option_value for your previous site url and change to localhost (e.g. www.domain.com to localhost)

Its best to run of port 80 though instead of 8888.

Belittle answered 15/1, 2015 at 15:38 Comment(3)
Great that worked, however if your using the site on localhost as suppose to the domain (if you were using it on one before) you will need to update those two fields, but if you been on localhost the whole time then this is of course irrelevant.Belittle
If you change only the port you won't be able to access to the admin part. So you need to change your site_url in wp_options as well.Gamecock
Changing port 8888 to 80 solved it for me on MAMP PRO 4.Tournedos
K
-3

if the no solution works then consider also checking the url should be set to http:://localhost/wordpress sometimes the url automatically converts from http to https and this cause error so make sure that while requesting wordpress website or dashboard your requested url should be http not https

Ketchup answered 30/6 at 13:38 Comment(1)
stackoverflow.com/help/how-to-answerYlem

© 2022 - 2024 — McMap. All rights reserved.