title: Access forbidden! Windows 10 PHP XAMPP
body: <p>Suddenly, i got this error when trying to submit my form. It worked fine until now.</p>
  
  <blockquote>
    <p>Access forbidden!</p>
    
    <p>You don't have permission to access the requested object. It is either
    read-protected or not readable by the server.</p>
    
    <p>If you think this is a server error, please contact the webmaster.</p>
    
    <p>Error 403</p>
    
    <p>localhost Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.1</p>
  </blockquote>
  
  <p>Already Tried
  <a href="https://stackoverflow.com/questions/17816732/xampp-access-forbidden-php">Xampp Access Forbidden php</a>
  's most voted answer, nothing change</p>
  
  <p>My httpd-xampp after the changes and still have the problem</p>
  
  <pre><code>#
  # XAMPP settings
  #
  
  &lt;IfModule env_module&gt;
      SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
      SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
      SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
      SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
      SetEnv PHPRC "\\xampp\\php"
      SetEnv TMP "\\xampp\\tmp"
  &lt;/IfModule&gt;
  
  #
  # PHP-Module setup
  #
  LoadFile "C:/xampp/php/php7ts.dll"
  LoadFile "C:/xampp/php/libpq.dll"
  LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
  
  &lt;FilesMatch "\.php$"&gt;
      SetHandler application/x-httpd-php
  &lt;/FilesMatch&gt;
  &lt;FilesMatch "\.phps$"&gt;
      SetHandler application/x-httpd-php-source
  &lt;/FilesMatch&gt;
  
  #
  # PHP-CGI setup
  #
  #&lt;FilesMatch "\.php$"&gt;
  #    SetHandler application/x-httpd-php-cgi
  #&lt;/FilesMatch&gt;
  #&lt;IfModule actions_module&gt;
  #    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
  #&lt;/IfModule&gt;
  
  
  &lt;IfModule php7_module&gt;
      PHPINIDir "C:/xampp/php"
  &lt;/IfModule&gt;
  
  &lt;IfModule mime_module&gt;
      AddType text/html .php .phps
  &lt;/IfModule&gt;
  
  ScriptAlias /php-cgi/ "C:/xampp/php/"
  &lt;Directory "C:/xampp/php"&gt;
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride None
      Options None
      Require all granted
      Order Allow,Deny
      Allow from All
      &lt;Files "php-cgi.exe"&gt;
            Require all granted
      &lt;/Files&gt;
  &lt;/Directory&gt;
  
  &lt;Directory "C:/xampp/cgi-bin"&gt;
      &lt;FilesMatch "\.php$"&gt;
          SetHandler cgi-script
      &lt;/FilesMatch&gt;
      &lt;FilesMatch "\.phps$"&gt;
          SetHandler None
      &lt;/FilesMatch&gt;
  &lt;/Directory&gt;
  
  &lt;Directory "C:/xampp/htdocs/xampp"&gt;
      &lt;IfModule php7_module&gt;
          &lt;Files "status.php"&gt;
              php_admin_flag safe_mode off
          &lt;/Files&gt;
      &lt;/IfModule&gt;
      AllowOverride AuthConfig
  &lt;/Directory&gt;
  
  &lt;IfModule alias_module&gt;
      Alias /licenses "C:/xampp/licenses/"
      &lt;Directory "C:/xampp/licenses"&gt;
          Options +Indexes
          &lt;IfModule autoindex_color_module&gt;
              DirectoryIndexTextColor  "#000000"
              DirectoryIndexBGColor "#f8e8a0"
              DirectoryIndexLinkColor "#bb3902"
              DirectoryIndexVLinkColor "#bb3902"
              DirectoryIndexALinkColor "#bb3902"
          &lt;/IfModule&gt;
          Require local
          ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
     &lt;/Directory&gt;
  
      Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
      &lt;Directory "C:/xampp/phpMyAdmin"&gt;
          AllowOverride AuthConfig
          Require local
          ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
      &lt;/Directory&gt;
  
      Alias /webalizer "C:/xampp/webalizer/"
      &lt;Directory "C:/xampp/webalizer"&gt;
          &lt;IfModule php7_module&gt;
              &lt;Files "webalizer.php"&gt;
                  php_admin_flag safe_mode off
              &lt;/Files&gt;
          &lt;/IfModule&gt;
          AllowOverride AuthConfig
          Require local
          ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
      &lt;/Directory&gt;
  &lt;/IfModule&gt;
  
  &lt;Directory "C:\xampp\htdocs\map"&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride all
          Order Deny,Allow
          Allow from all
          Require all granted
  &lt;/Directory&gt;
  
  
  
  &lt;IfModule mime_module&gt;
      AddType text/html .php .phps
  &lt;/IfModule&gt;
  
  ScriptAlias /php-cgi/ "C:/xampp/php/"
  &lt;Directory "C:/xampp/php"&gt;
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride None
      Options None
      Require all granted
      Order Allow,Deny
      Allow from All
      &lt;Files "php-cgi.exe"&gt;
            Require all granted
      &lt;/Files&gt;
  &lt;/Directory&gt;
  
  &lt;Directory "C:/xampp/cgi-bin"&gt;
      &lt;FilesMatch "\.php$"&gt;
          SetHandler cgi-script
      &lt;/FilesMatch&gt;
      &lt;FilesMatch "\.phps$"&gt;
          SetHandler None
      &lt;/FilesMatch&gt;
  &lt;/Directory&gt;
  
  &lt;Directory "C:/xampp/htdocs/xampp"&gt;
      &lt;IfModule php7_module&gt;
          &lt;Files "status.php"&gt;
              php_admin_flag safe_mode off
          &lt;/Files&gt;
      &lt;/IfModule&gt;
      AllowOverride AuthConfig
  &lt;/Directory&gt;
  
  &lt;IfModule alias_module&gt;
      Alias /licenses "C:/xampp/licenses/"
      &lt;Directory "C:/xampp/licenses"&gt;
          Options +Indexes
          &lt;IfModule autoindex_color_module&gt;
              DirectoryIndexTextColor  "#000000"
              DirectoryIndexBGColor "#f8e8a0"
              DirectoryIndexLinkColor "#bb3902"
              DirectoryIndexVLinkColor "#bb3902"
              DirectoryIndexALinkColor "#bb3902"
          &lt;/IfModule&gt;
          Require local
          ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
     &lt;/Directory&gt;
  
      Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
      &lt;Directory "C:/xampp/phpMyAdmin"&gt;
          AllowOverride AuthConfig
          Require local
          ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
      &lt;/Directory&gt;
  
      Alias /webalizer "C:/xampp/webalizer/"
      &lt;Directory "C:/xampp/webalizer"&gt;
          &lt;IfModule php7_module&gt;
              &lt;Files "webalizer.php"&gt;
                  php_admin_flag safe_mode off
              &lt;/Files&gt;
          &lt;/IfModule&gt;
          AllowOverride AuthConfig
          Require local
          ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
      &lt;/Directory&gt;
  &lt;/IfModule&gt;
  
  &lt;Directory "C:\xampp\htdocs\map"&gt;
          Options Indexes FollowSymLinks MultiViews
          AllowOverride all
          Order Deny,Allow
          Allow from all
          Require all granted
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Changes that I made:</p>
  
  <pre><code>&lt;Directory "C:/xampp/php"&gt;
          Options Indexes FollowSymLinks Includes ExecCGI
          AllowOverride None
          Options None
          Require all granted
          Order Allow,Deny
          Allow from All
          &lt;Files "php-cgi.exe"&gt;
                Require all granted
          &lt;/Files&gt;
      &lt;/Directory&gt;
  
  &lt;Directory "C:\xampp\htdocs\map"&gt;
              Options Indexes FollowSymLinks MultiViews
              AllowOverride all
              Order Deny,Allow
              Allow from all
              Require all granted
      &lt;/Directory&gt;
  </code></pre>
  
  <p>My htttpd-vhosts without changes</p>
  
  <pre><code># Virtual Hosts
  #
  # Required modules: mod_log_config
  
  # If you want to maintain multiple domains/hostnames on your
  # machine you can setup VirtualHost containers for them. Most configurations
  # use only name-based virtual hosts so the server doesn't need to worry about
  # IP addresses. This is indicated by the asterisks in the directives below.
  #
  # Please see the documentation at 
  # &lt;URL:http://httpd.apache.org/docs/2.4/vhosts/&gt;
  # for further details before you try to setup virtual hosts.
  #
  # You may use the command line option '-S' to verify your virtual host
  # configuration.
  
  #
  # Use name-based virtual hosting.
  #
  ##NameVirtualHost *:80
  #
  # VirtualHost example:
  # Almost any Apache directive may go into a VirtualHost container.
  # The first VirtualHost section is used for all requests that do not
  # match a ##ServerName or ##ServerAlias in any &lt;VirtualHost&gt; block.
  #
  ##&lt;VirtualHost *:80&gt;
      ##ServerAdmin webmaster@dummy-host.example.com
      ##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
      ##ServerName dummy-host.example.com
      ##ServerAlias www.dummy-host.example.com
      ##ErrorLog "logs/dummy-host.example.com-error.log"
      ##CustomLog "logs/dummy-host.example.com-access.log" common
  ##&lt;/VirtualHost&gt;
  
  ##&lt;VirtualHost *:80&gt;
      ##ServerAdmin webmaster@dummy-host2.example.com
      ##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
      ##ServerName dummy-host2.example.com
      ##ErrorLog "logs/dummy-host2.example.com-error.log"
      ##CustomLog "logs/dummy-host2.example.com-access.log" common
  ##&lt;/VirtualHost&gt;
  </code></pre>