无法连接到本地主机中的wordpress(GET http://localhost/net::ERR_CONNECTION_REFUSED)

问题描述 投票:0回答:2

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

我将它们移至本地 MAMP。

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

并且错误消息

(GET http://localhost/ net::ERR_CONNECTION_REFUSED)
显示在 chrome 中。

有人可以给我一些提示吗?

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

然后连接到http://localhost:8888/test,正如预期的那样显示“debug”。

谢谢。

php wordpress
2个回答
13
投票

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

在您的 phpMyAdmin 上(应该是 http://localhost/phpmyadmin

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

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


0
投票

如果没有解决方案有效,请考虑检查 url 应设置为 http:://localhost/wordpress 有时 url 会自动从 http 转换为 https,这会导致错误,因此请确保在请求 wordpress 网站或仪表板时您请求的 url应该是http而不是https

© www.soinside.com 2019 - 2024. All rights reserved.