403:您无权访问此服务器上的/index.php [英] 403:You don't have permission to access /index.php on this server

查看:220
本文介绍了403:您无权访问此服务器上的/index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我访问我的网站时,我面临以下消息:

I'm facing the following message when I visit my website:

您无权访问此服务器上的/index.php.

You don't have permission to access /index.php on this server.

我可以使用相同的URL访问其他网站,如 http://xiukun.wang/scrapy/,但 http://xiukun.wang/datavis/不起作用.

I am able to visit my other website in same URL, as in http://xiukun.wang/scrapy/, but http://xiukun.wang/datavis/ doesn't work.

我尝试了许多方法来解决它,例如编辑我的 httpd.conf 文件,但是它不起作用.我该怎么解决?

I have tried many methods to solve it, like editing my httpd.conf file, however it doesn't work. How do I solve it?

<Directory "/alidata/www">
    AllowOverride none
    Require all granted
</Directory>

DocumentRoot "/alidata/www"
<Directory "/alidata/www">
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
</Directory>

推荐答案

您是否更改了.htaccess文件中的任何内容?您还更改了配置文件中的任何内容,例如数据库名称用户并通过了吗?

Have you changed anything in your .htaccess file? Also did you change anything in config file such as DB name user and pass?

还将权限更新为您的public_html的755.

Also update the permissions to 755 of your public_html.

编辑

由于您指定了它的apache,请尝试以下解决方案:

Since you specified its apache, try these solutions:

  • 您可以打开APACHE配置文件并找出索引名称吗?
  • 检查您的Directive DirectoryIndex并确保列出您的索引,否则上传:

  • Can you open your APACHE config file and find out the index name?
  • Check your Directive DirectoryIndex and make sure your index is listed, or else upload:

   DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

检查正确的目录权限:

<Directory "/home/domain/www">
        Options +Indexes FollowSymLinks +ExecCGI
        AllowOverride AuthConfig FileInfo
        Order allow,deny
        Allow from all
</Directory>

  • 修改APACHE所在的主目录的文件系统权限已安装:

  • Modify file system permissions of Home directory that APACHE is installed:

    #chmod a+x /apache-home-dir-of installation
    

  • 确保所请求的CGI脚本具有在上设置的可执行权限文件.使用chmod命令设置权限:

  • Make sure the CGI script requested have executable permissions set on files. Use chmod command to set permission:

    $ chmod +x file.cgi
    

  • 检查APACHE日志中的错误:

  • Check APACHE logs for errors:

    # tail -f /path/to/apache/error.logs
    

  • 来源: https://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/

    这篇关于403:您无权访问此服务器上的/index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆