Wordpress中的HTTP错误403禁止问题

问题描述 投票:-2回答:1

我有最新版本的wordpress以及woocommerce安装。我在过去几个月面临的问题是,有时当我尝试从我的Windows 10笔记本电脑访问网站时,它显示空白页面 -

enter image description here

无论我在笔记本电脑上使用哪种浏览器,它都会发生。我尝试过使用Chrome,Firefox和Edge。当我清除浏览器的历史记录和缓存时,我的网站开始加载正常。该问题会影响整个网站,包括管理部分,主页或任何其他网页。

出于某种原因,这个问题只出现在我的笔记本电脑上。我在Android手机上从未遇到过这个问题。我甚至检查过在手机和笔记本电脑上同时加载网站。当它在移动设备上正确加载时,我在笔记本电脑上遇到了同样的问题

当它显示空白时,我决定检查页面的源代码。在源代码中,我可以看到它显示错误“HTTP错误403 - 禁止.Web服务器配置为不列出此目录的内容,或者您​​没有足够的权限来访问资源”。

源代码如下所述。有人能说出这个问题是什么吗?我在同一主机方案上有另一个wordpress网站,它从未面对过这个问题。站点名称是oldbookdepot(dot)in

<!DOCTYPE html>
<html>
<body>
  <script>

  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("demo").innerHTML =
      this.responseText;
      document.getElementById("first-header").innerHTML = "HTTP Error 403 - Forbidden";
      document.getElementById("second-sub-header").innerHTML = "The Web server is configured to not list the contents of this directory or you do not have enough permissions to access the resource";
      var get=document.getElementsByTagName("A");
      for(i=0; i<get.length; i++){
        get[i].removeAttribute("onmouseover");
        get[i].removeAttribute("onmouseout");
      }
    }
  };
  xhttp.open("GET", "/errors/MultiDomainHosting.php", true);
  xhttp.send();

  </script>
<style>

.wrapper{
  overflow-y: hidden;
  padding: 0px;
  margin:0px;
  background: none !important;
  width: 100% !important;
}
.header-container {
  text-align: -webkit-center;
  width: 100%;
  height: 150px;
  background: white;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: larger;
}
.header-container > p,h1 {
  padding:5px;
}
.header-container > p {
  color: #707070;
}
.header-container > h1 {
  color: #333333;
}
.content-container {
  position: absolute;
  background-color: #202020;
  height: 635px;
  width: 100%;
}
.dynamic-content {
  position: relative !important;
  padding: 0 10em 0 10em;
  top: -50px;
}
.dynamic-content > div {
  border-style: solid;
  border-width: 0 10px 10px 10px;
  border-color: #e1e1e1;
  height: 550px;
  overflow-y: hidden;
}
@media only screen and (max-width:480px) {
  .dynamic-content > div {
    border-style: solid;
    border-width: 0 2px 2px 2px;
    border-color: #e1e1e1;
    overflow-y: hidden;
    height: auto;
  }
  .dynamic-content {
    padding: 0;
    top: 0;
  }
  .content-container {
    height: auto;
  }
}
@media only screen and (max-width: 768px) and (min-width: 481px)  {
  .dynamic-content > div {
    border-style: solid;
    border-width: 0 5px 5px 5px;
    border-color: #e1e1e1;
    overflow-y: hidden;
    height: auto;
  }
  .dynamic-content {
    padding: 0 2em 0 2em;
    top: 0;
  }
  .content-container {
    height: auto;
  }
}
</style>
<div class="wrapper" id="wrapper">
  <div class="header-container">
    <h1 id="first-header"></h1>
    <p id="first-sub-header"></p>
    <p id="second-sub-header"></p>
  </div>
  <div class="content-container">
  </div>
  <div class="dynamic-content" id="demo">
  </div>
</div>

</body>
</html>
php css wordpress http-status-code-403
1个回答
0
投票

很多时候,随机白屏死机(WSOD)在没有干预的情况下消失的原因是没有足够的内存分配给主机帐户或WordPress。

  1. [WordPress内存设置] [1] https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP
  2. 为了向PHP分配更多内存(WordPress不能超过,即使你告诉它使用更多内存),找到进行更改的位置也有点棘手。 cPanel和Plesk允许您通过面板进行操作...希望您在那里进行更改。否则,您需要找到正在使用的php.ini文件,并更新memory_limit = ...行。

有一点要记住,Plesk(我想象cPanel)也可以根据其他地方的设置自动生成大量文件。请注意php.ini文件上的标题,指出“此文件是自动生成的,将被覆盖 - 请勿在此处进行更改。”通过更改此文件,如果您解决了WSOD的问题,它将在下次服务器重新启动后返回。

无法在系统中找到可以更改PHP内存限制的任何位置? 在许多共享托管环境中,标准用户在分配内存时受托管公司的支配。虽然根据我的经验,有些人为我增加了规模,因为他们可能没有得到很多这样的要求。在花费太多时间试图找到进行修改的地方之前,请与他们联系。

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