【问题标题】:Forbidden access after upload project on host在主机上上传项目后禁止访问
【发布时间】:2017-04-23 12:32:31
【问题描述】:

我通过 yii2 在 localhost 中使用 xampp 创建了我的网站,它可以毫无问题地运行。

但现在 上传 我的网站在 linux 主机上后,我收到以下错误:

Forbidden

You don't have permission to access /index.php on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

这是我的 htaccess 内容:

RewriteEngine on
# If a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php 

为什么会出现这个错误?

【问题讨论】:

  • 更改你的app/web服务器目录的权限
  • @scaisEdge 请解释更多
  • 检查用户对您目录的权限查看此以获得简要说明linuxcommand.org/lts0070.php
  • @scaisEdge 我无权访问 shell 来编写这样的命令。
  • 我的所有文件有644权限

标签: php linux .htaccess web-services cpanel


【解决方案1】:

如果您使用的是 cpanel/WHM,您可以通过文件管理器更改权限。如果它仍然不适合您,请删除 index.php 并上传一个新的。

另外,检查文档根目录中的 .htaccess 是否有任何错误。

【讨论】:

  • 是的,我使用 cpanel。但我不知道我该怎么办
  • 我所有的php文件都是644权限。你的意思是我必须改变它?
猜你喜欢
  • 2017-05-04
  • 2019-06-27
  • 2015-05-24
  • 2021-11-11
  • 2012-11-04
  • 2017-11-26
  • 1970-01-01
  • 2021-12-10
  • 2019-10-01
相关资源
最近更新 更多