简体   繁体   中英

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

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

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

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.

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>

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

Also update the permissions to 755 of your public_html.

EDIT

Since you specified its apache, try these solutions:

  • 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 

    Check for correct dir permissions:

     <Directory "/home/domain/www"> Options +Indexes FollowSymLinks +ExecCGI AllowOverride AuthConfig FileInfo Order allow,deny Allow from all </Directory> 
  • Modify file system permissions of Home directory that APACHE is installed:

     #chmod a+x /apache-home-dir-of installation 
  • Make sure the CGI script requested have executable permissions set on files. Use chmod command to set permission:

     $ chmod +x file.cgi 
  • Check APACHE logs for errors:

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

Source: https://www.cyberciti.biz/faq/apache-403-forbidden-error-and-solution/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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