2013-05-12 320 views
0

操作系统:Ubuntu的
当我输入http://127.0.0.1/wordpress
显示错误:本地主机可以访问WordPress的,但127.0.0.1不能

Neither /etc/wordpress/config-127.0.0.1.php nor /etc/wordpress/config-0.0.1.php could be found. 
Ensure one of them exists, is readable by the webserver and contains the right password/username. 

http://localhost/wordpress可以访问

我用命令bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost这可能导致这个错误。我也想弄清楚这个命令是什么意思。

回答

2

finaly,我找出自己。下表wp_options

  1. ALTER SITEURL列,本地主机将举办机械ip.such作为下wp_options表http://192.168.2.16/wordpress
  2. ALTER家柱,并设置本地主机到主机机器的ip,同上。
    (如果不这样做1和2,你不能看到IMG)
  3. sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-default.php (这是因为在过去的wp-config.php文件查找配置,如default.php)

然后,这个问题解决了〜

+0

很好,谢谢!这使我可以使用其他设备访问我的LAN内我的笔记本电脑上安装的本地主机上的wp网站。我一直在努力寻找一个解决方案,你的程序工作得很好。 – umbe1987 2017-05-03 10:49:09

0

你的WordPress数据库可能配置为“localhost”的 您需要更改几个表项,使其工作

+0

bash/usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost。我使用上面的命令,我如何撤消它? – Mithril 2013-05-12 13:44:57

0

试一试,看是否映射设置来解决本地主机为127.0.0.1

尝试搭配chmod etc/hosts来644

127.0.0.1本地主机

+0

localhost解析为127.0.0.1 – Mithril 2013-05-12 13:45:23

0

根据上述答案,这没有奏效,一个Debian Jessi 8.1,因为/etc/wordpress/config-default.php不存在。

不过,我所做的:

LN -s /etc/wordpress/config-dev.php /etc/wordpress/config-localhost.php

这让我过去这一关。然而,接下来的问题是“ 按照上面的回答,这没有工作,一个Debian的杰西8.1,因为/etc/wordpress/config-default.php不存在

不过,我所做的:

LN -s /etc/wordpress/config-dev.php /etc/wordpress/config-localhost.php

这让我过去这一关。

然而,接下来的问题是“错误建立数据库连接“这是超出了这个问题的范围。

相关问题