skip to Main Content

Read almost all questions here, but no solution found. This drives me crazy already to do such simple stuff to run PHP on my localhost…

You don’t have permission to access this resource.Server unable to
read htaccess file, denying access to be safe

ls -l
-rwxrwxrwx 1 user user 51 sep 27 14:42 .htaccess

ls -l
drwxrwxr-x 2 user user 4096 sep 27 15:17 www

Any help appreciated!

2

Answers


  1. Check if there is an .htaccess file inside the www folder (and its permissions), since Apache looks for one at every directory up to the one where the requested file exists.

    Login or Signup to reply.
  2. I’m coming from an Apache on Windows server background, but in regards to the .htaccess file, you can also put a "AllowOverride None" in your section of your httpd.conf file. At least in Windows, this means nothing can be overridden, therefore no need to look for .htaccess files.
    You can also add a line to tell Apache that the "AccessFileName" is blank. Here are the entried I’m speaking of from my config file. I’m running a XAMPP server on Windows.

    DocumentRoot "C:/xampp/htdocs"
    <Directory "C:/xampp/htdocs">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride None
        Require all granted
    </Directory>
    AccessFileName ""
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search