Search code examples
phpwordpress

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


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.


Solution

  • 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.