简体   繁体   English

"wordpress 403错误(复印机安装)"

[英]wordpress 403 error (duplicator installation)

I have duplicated my site using the duplicator plugin from wordpress.org.我使用 wordpress.org 的复制器插件复制了我的网站。 However, when I wanted to run this on a new hosting service, first I encountered a 504 gateway timeout error.但是,当我想在新的托管服务上运行它时,我首先遇到了 504 网关超时错误。 Therefore, I extracted the .zip contents and chose for manual package extraction, which solved the problem, but after the second step, again in the final step (test), I run into a 403 access denied error.因此,我提取了 .zip 内容并选择了手动解包,这样解决了问题,但是在第二步之后,再次在最后一步(测试)中,我遇到了 403 access denied 错误。

  1. I checked my access permissions, they were OK.我检查了我的访问权限,他们没问题。 (755 for folders and 644 or 666 for files) (文件夹为 755,文件为 644 或 666)
  2. I checked my .htaccess file, it seemed to be OK.我检查了我的 .htaccess 文件,似乎没问题。 (I deleted it and the error appeared again). (我删除了它,错误又出现了)。
  3. There are no plugins on my domain or host which might cause interference as I am installing the package afresh.在我重新安装软件包时,我的域或主机上没有可能会造成干扰的插件。

I don't know what is causing this problem.我不知道是什么导致了这个问题。

My .htaccess file contents:我的 .htaccess 文件内容:

# 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

403 Forbidden error code is shown when your server permissions don't allow access to a specific page.当您的服务器权限不允许访问特定页面时,将显示 403 Forbidden 错误代码。

Another possible cause could be a corrupt .htaccess file or incorrect file permissions on your server.另一个可能的原因可能是损坏的 .htaccess 文件或服务器上的文件权限不正确。

If you were already using an automatic WordPress backup plugin, then make sure that you have access to the latest backup before moving forward.如果您已经在使用自动 WordPress 备份插件,请确保在继续之前您可以访问最新的备份。

Deactivate all WordPress plugins停用所有 WordPress 插件

  • First thing you need to do is to temporarily deactivate all WordPress plugins.您需要做的第一件事是暂时停用所有 WordPress 插件。 This includes any security plugins that you may have installed on your site.这包括您可能已在您的站点上安装的任何安全插件。
  • If this resolves your problem, then this means one of the plugins on your website was causing this error.如果这解决了您的问题,则意味着您网站上的插件之一导致了此错误。
  • You can figure out which plugin was causing the error by activating all your plugins one at a time until you are able to reproduce the 403 forbidden error.您可以通过一次激活所有插件来找出导致错误的插件,直到您能够重现 403 禁止错误为止。

Corrupt .htaccess File损坏的 .htaccess 文件

  • Often the 403 error is caused by a corrupt .htaccess file in your WordPress site.通常 403 错误是由 WordPress 站点中损坏的 .htaccess 文件引起的。 Repairing this file is quite easy.修复这个文件很容易。

  • You need to delete the file from your server.您需要从服务器中删除该文件。 (get backup file) (获取备份文件)

  • Try accessing your website.尝试访问您的网站。 If 403 forbidden error is resolved, then this means that your .htaccess file was corrupt.如果 403 forbidden 错误得到解决,则意味着您的 .htaccess 文件已损坏。

  • You can generate a fresh .htaccess file by logging into your WordPress admin area and going to Settings » Permalinks page.您可以通过登录您的 WordPress 管理区域并转到设置»永久链接页面来生成一个新的 .htaccess 文件。 Simply click on the Save Changes button at the bottom of the page and WordPress will generate a fresh .htaccess file.只需单击页面底部的“保存更改”按钮,WordPress 就会生成一个新的 .htaccess 文件。

File Permissions in WordPress WordPress 中的文件权限

  • All folders on your WordPress site should have a file permission of 744 or 755.您的 WordPress 站点上的所有文件夹都应具有 744 或 755 的文件权限。

  • All files on your WordPress site should have a file permission of 644 or 640.您的 WordPress 站点上的所有文件都应具有 644 或 640 的文件权限。

  • You can set the file permission to the root folder to 744 or 755. Check the box next to 'Recurse into subdirectories' and then check the option that says 'apply to directories only'.您可以将根文件夹的文件权限设置为 744 或 755。选中“递归到子目录”旁边的框,然后选中“仅应用于目录”选项。

I hope this helped you fix the 403 forbidden error in WordPress我希望这能帮助您修复 WordPress 中的 403 禁止错误

This is old but I would like to post something I'm about to try.这是旧的,但我想发布一些我即将尝试的东西。 I found that "open_basedir" may be enabled by default on some hosts, like the one I'm using.我发现“open_basedir”可能在某些主机上默认启用,就像我正在使用的那样。 So I sent a request to the provider to disable it from "php.ini" file.所以我向提供商发送了一个请求,要求从“php.ini”文件中禁用它。

Delete .htaccess files from all folders.从所有文件夹中删除.htaccess文件。 Solved .解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM