Wordpress 403/404 错误:您无权访问此服务器上的 /wp-admin/themes.php
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2785482/
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
Wordpress 403/404 Errors: You don't have permission to access /wp-admin/themes.php on this server
提问by Glen
Some background:
一些背景:
I setup six blogs this week, all using Wordpress 2.92, installed with Fantastico on a baby croc plan with Hostgator.
本周我设置了六个博客,全部使用 Wordpress 2.92,在带有 Hostgator 的婴儿鳄鱼计划中安装了 Fantastico。
I used the same theme (heatmap 2.5.4) and plugins for each blog.
我为每个博客使用了相同的主题(热图 2.5.4)和插件。
They were all up and running, no issues at all.
它们都已启动并运行,完全没有问题。
I go to create a new blog this morning, using the same setup, and when I try to change the theme settings, I get the following error:
今天早上我去创建一个新博客,使用相同的设置,当我尝试更改主题设置时,出现以下错误:
Forbidden
You don't have permission to access /wp-admin/themes.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8n DAV/2 mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.mydomain.com Port 80
I tried uninstalling WP and doing a clean install, still the same issue with a clean installation.
我尝试卸载 WP 并进行全新安装,但仍然存在与全新安装相同的问题。
So I went back and checked the six other blogs that I had setup over the last week or so, and they are also now giving me 403 or 404 errors when trying to change theme settings, and everytime there's an error it points to either themes.php or functions.php
所以我回去检查了我在上周左右设置的其他六个博客,当尝试更改主题设置时,它们现在也给我 403 或 404 错误,并且每次出现错误时都指向任一主题。 php或functions.php
At this point I'm at my wits end trying to figure out what the problem is. Hostgator support looked at it and thought maybe it was a permissions issue but they reset those and I'm still having the problem.
在这一点上,我不知所措,试图找出问题所在。Hostgator 支持人员查看了它并认为可能是权限问题,但他们重置了这些,我仍然遇到问题。
At first I thought the problem might have been related to a plugin I recently installed on the previous six blogs that morning (ByREV Fix Missed Shedule Plugin) to deal with a missed schedule bug with WP 2.92, and that maybe that had mucked things up. But then I checked a blog I built months ago, also using the same theme and plugins, and now it too is also encountering the same problem.
起初我认为这个问题可能与我最近在那天早上的前六个博客上安装的插件(ByREV Fix Missed Shedule Plugin)有关,以处理 WP 2.92 的一个错过的日程安排错误,这可能把事情搞砸了。但是后来我查看了我几个月前建立的博客,也使用了相同的主题和插件,现在它也遇到了同样的问题。
Any ideas? I tried deleting my htaccess, uploading a blank one, uploading one with this snippet I found on the hostgator forum:
有任何想法吗?我尝试删除我的 htaccess,上传一个空白的,用我在 hostgator 论坛上找到的这个片段上传一个:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Nothing has worked. I still get 403 or 404 errors everytime. Everything was working perfectly yesterday so I know this setup DOES WORK, I've just mucked something up somewhere and I'm clueless what it is.
没有任何效果。我每次仍然收到 403 或 404 错误。昨天一切正常,所以我知道这个设置确实有效,我只是在某处搞砸了一些东西,我不知道它是什么。
I read a related thread here and tried chmoding the wp-content folder to 0755 and still having the issue.
我在这里阅读了一个相关的线程,并尝试将 wp-content 文件夹修改为 0755,但仍然存在问题。
Any thoughts? Thanks!
有什么想法吗?谢谢!
采纳答案by markratledge
The first error you're getting - permissions - is the most indicative. Bump wp-content and wp-admin to 777 and try it, and if it works, then change them both back to 755 and see if it still works. What are you using to change folder permissions? An FTP client?
您遇到的第一个错误 - 权限 - 是最具指示性的。将 wp-content 和 wp-admin 改为 777 并尝试一下,如果有效,则将它们都改回 755,看看是否仍然有效。你用什么来更改文件夹权限?FTP客户端?
回答by Dakota
A few years late, but I have a solution for the most recent version of WordPress, which has this same issue (WordPress-generated .htaccess files break sites, reuslting in 403 Forbidden error messages). Here's that it looks like when WordPress creates it:
晚了几年,但我有最新版本的 WordPress 的解决方案,它有同样的问题(WordPress 生成的 .htaccess 文件破坏了站点,在 403 Forbidden 错误消息中重新使用)。这是 WordPress 创建时的样子:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
The problem is that the conditional doesn't work. It doesn't work because the module it's looking for isn't .c
, it's .so
. I think this is a platform-specific, or configuration-specific issue, where Mac OS and Lunix Apache installations are set up for .so
AKA 'shared-object' modules. Looking for a .c
module shouldn't break the conditional, I think that's a bug, but it's the issue.
问题是条件不起作用。它不起作用,因为它正在寻找的模块不是.c
,而是.so
. 我认为这是一个特定于平台或特定于配置的问题,其中 Mac OS 和 Lunix Apache 安装是为.so
AKA“共享对象”模块设置的。寻找一个.c
模块不应该打破条件,我认为这是一个错误,但这是问题所在。
Simply change the mod_rewrite.c
to mod_rewrite.so
and you're all set to go!
只需更改mod_rewrite.c
为mod_rewrite.so
,您就可以开始了!
# BEGIN WordPress
<IfModule mod_rewrite.so>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
回答by allen white
We found the asnwer of at techieshelp..its the htaccess thats the issue...
我们在 techieshelp 找到了答案……它的 htaccess 就是问题所在……
回答by Glen
Just to follow up, problem solved! I mentioned mod_sec settings for my server as being the possible culprit as suggested and they were able to fix this issue. Here's what the tech agent said to tell them when you go to support:
只是为了跟进,问题已解决!我提到我的服务器的 mod_sec 设置可能是建议的罪魁祸首,他们能够解决这个问题。这是技术代理在您寻求支持时告诉他们的内容:
Just let them know you need the rule 340163 whitelisted for domain.com as its hitting a mod_sec rule.
只要让他们知道您需要将规则 340163 列入 domain.com 白名单,因为它符合 mod_sec 规则。
Apparently you will need to do this for each domain that is having the issue, but it works. Thanks for all the suggestions everyone!
显然,您需要为出现问题的每个域执行此操作,但它确实有效。感谢大家的所有建议!
回答by Tony
You're in luck bud...I had the same issue but had more tech knowledge on the matter and was able to determine that it was a mod_sec issue that hostgator has to fix/whitelist on their own. You cannot do it yourself. Simply ask the hostgator tech to check mod_sec settings on your server.
你很幸运……我有同样的问题,但在这方面有更多的技术知识,并且能够确定这是一个 mod_sec 问题,hostgator 必须自己修复/白名单。你不能自己做。只需要求主机技术人员检查您服务器上的 mod_sec 设置。
Enjoy your fixed issue ;D
享受你的固定问题;D
回答by Alexandru
I had the same problem, but nothing above worked...try a really simple solution...
我遇到了同样的问题,但上面没有任何工作......尝试一个非常简单的解决方案......
Back up your .htaccess file. Delete it from your root directory. Then try accessing those directories. Its likely that whatever rewrite conditions you had in your file were causing those access issues. The index page should be picked up automatically on most hosts. :P
备份您的 .htaccess 文件。从您的根目录中删除它。然后尝试访问这些目录。您的文件中的任何重写条件都可能导致这些访问问题。大多数主机上应该会自动选取索引页。:P
回答by Nimezzz
Try to disable ModSecurity from your cPanel. Log into your cPanel. Find the category "Security". There you can find ModSecurity link.Click on it and disable it for the domain you are facing the 403 error.
尝试从您的 cPanel 禁用 ModSecurity。登录您的 cPanel。找到“安全”类别。在那里您可以找到 ModSecurity 链接。单击它并为您面临 403 错误的域禁用它。
Some 403 errors can be solved by this method too. Go to the wordpress dashboard, settings>permalink and just click save.
一些 403 错误也可以通过这种方法解决。转到 wordpress 仪表板,设置>永久链接,然后单击保存。
Hope this helped. :)
希望这有帮助。:)
回答by Buck Rackley
Hopefully people will find this answer as there are many, many posts about this on the web. Many people suggested it was an .htaccess problem, and for me it was. However, I had been looking in the .htaccess in the root, not in the .htaccess in the wp-admin folder. Normally, I work on this site in particular through terminal services, so when it booted me and I couldn't log back in, I was trying to access it from my home computer (and it's IP).
希望人们能找到这个答案,因为网上有很多关于这个的帖子。许多人认为这是一个 .htaccess 问题,对我来说确实如此。但是,我一直在查看根目录中的 .htaccess,而不是 wp-admin 文件夹中的 .htaccess。通常,我特别是通过终端服务在这个站点上工作,所以当它启动我并且我无法重新登录时,我试图从我的家用计算机(和它的 IP)访问它。
Silly me forgot the IP restriction I had placed in the wp-admin .htaccess file.
愚蠢的我忘记了我在 wp-admin .htaccess 文件中放置的 IP 限制。
AuthName "Protected"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 11.11.11.11
</Limit>
If you have something like this in your wp-admin .htaccess files, that would easily explain why all the sites you work on ceased to function at the same time. Internet providers occasionally rotate IPs so that nobody is running a server from home without paying for it.
如果您的 wp-admin .htaccess 文件中有类似的内容,这很容易解释为什么您工作的所有站点同时停止运行。互联网提供商偶尔会轮换 IP,因此没有人会在不付费的情况下在家中运行服务器。
回答by Mitch Dempsey
Did you try:
你试过了吗:
<Directory /path/to/your/wp-admin>
Order allow,deny
Allow from all
</Directory>