php 无法连接到 localhost 中的 wordpress (GET http://localhost/net::ERR_CONNECTION_REFUSED)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27966733/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:38:53  来源:igfitidea点击:

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

phpwordpress

提问by wilson Liu

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

我只是在虚拟网络托管中备份 wordpress DB 和 public_html 文件夹。

And I move them to my local MAMP.

我将它们移动到我当地的 MAMP。

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

但是当我输入http://localhost:8888/ 时,它只是转移到http://localhost

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

错误消息(GET http://localhost/ net::ERR_CONNECTION_REFUSED)显示在 chrome 中。

Could some one give me some hint?

有人能给我一些提示吗?

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

我曾尝试在 /htdoc/test 中放置一个带有 echo "debug" 的虚拟 index.php

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

然后连接到http://localhost:8888/test,它按预期显示“调试”。

Thanks.

谢谢。

回答by Danny Broadbent

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

更改 Wordpress 数据库上的站点 url 和主页 url。

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

在您的 phpMyAdmin 上(应该是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)

转到您的选项表,搜索您以前站点 url 的 option_value 并更改为 localhost(例如 www.domain.com 到 localhost)

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

最好运行端口 80 而不是 8888。