title: CentOS + Apache: You don't have permission to access /info.php on this server
body: <p>I have installed CentOS 7 with Apache Web Server and PHP. But when I try to test php I've got this error</p>
  
  <p><a href="https://i.stack.imgur.com/SetLT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SetLT.png" alt="enter image description here"></a></p>
  
  <p>The user and group of info.php are "apache"</p>
  
  <p><a href="https://i.stack.imgur.com/YHNqg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YHNqg.png" alt="enter image description here"></a></p>
  
  <p>My Document Root is defined like you can see:</p>
  
  <p><a href="https://i.stack.imgur.com/29MyT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/29MyT.png" alt="enter image description here"></a></p>
  
  <p>If I try to access with <a href="http://localhost" rel="nofollow noreferrer">http://localhost</a> it works, but when I try to access with <a href="http://localhost/info.php" rel="nofollow noreferrer">http://localhost/info.php</a> then it fails!!!</p>
  
  <p>I have installed php and php-fpm package. Maybe Would I need other packages?</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Edit I:</strong></p>
  
  <p>Looking for an error in access_log file I have found this error:</p>
  
  <p><a href="https://i.stack.imgur.com/awJiL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/awJiL.png" alt="enter image description here"></a></p>
  
  <p>Why I get this error?</p>
  
  <p><strong>Edit II:</strong></p>
  
  <p>Looking for in error_log file I have found that is a problem of permissions:</p>
  
  <pre><code>[Tue Jul 24 18:44:21.084670 2018] [mime_magic:error] [pid 4986] [client ::1:38162] AH01512: mod_mime_magic: can't read `/var/www/html/info.php'
      [Tue Jul 24 18:44:21.084848 2018] [core:error] [pid 4986] (13)Permission denied: [client ::1:38162] AH00132: file permissions deny server access: /var/www/html/info.php
  </code></pre>
  
  <p>But the file belongs to "apache" user and group ... :(</p>
  
  <p><a href="https://i.stack.imgur.com/ZI5r4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZI5r4.png" alt="enter image description here"></a></p>
  
  <p><strong>Edit III:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/RI8o1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RI8o1.png" alt="enter image description here"></a></p>