title: PHP using file() to read in file in subdirectory
body: <p>Running PHP5+ on NGINX Server.  I am reading a file into an array using PHP file().  I have a PHP/Javascript function that works <strong>perfectly</strong> when the file I am reading in is in the <strong>same</strong> directory.  Code:</p>
  
  <pre><code>var attribute = [&lt;?php 
      $data = file("ATTRIBS.txt");
      $n = count($data);
      for ($v = 1; $v &lt;= $n; $v++) {
          print '"'.trim($data[$v-1]).'",';
      }?&gt;];   
  </code></pre>
  
  <p>However, in the final version, I want to have multiple ATTRIBS files in a subfolder, "/sysBuilds".</p>
  
  <p>If I change the file() line to read</p>
  
  <pre><code>$data = file("sysBuilds/ATTRIBS.txt");
  </code></pre>
  
  <p>or /sysBuilds or /var/www/html/sysBuilds...  the function fails to pick up the data in the file.  I've seen things about FILE_INCLUDE_PATH but none of it (at least to me with my current level of understanding) seems to make any sense or fit what I am trying to do.  I'm sure this is an easy issue but I'm just not recognizing what I need to be able to recognize what the answer is here...  appreciate some guideance.  Thanks.</p>
  
  <p>EDIT:  Permissions and error log output:</p>
  
  <pre><code>2018/03/28 21:16:40 [error] 805#0: *129 FastCGI sent in stderr: "PHP message: PHP Warning:  file(./HostBuilds/ATTRIBS.txt): failed to open stream: Permission denied in /var/www/html/BehaviorPad.php on line 159" while reading upstream, client: 192.168.1.3, server: 192.168.1.201, request: "GET /BehaviorPad.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.1.201"
  </code></pre>
  
  <p>Perms:</p>
  
  <pre><code>/sysBuilds drwxrw-rw-
  /sysBuilds/ATTRIBS.txt -rwxrw-rw-
  BehaviorPad.php -rwxrwxrwx
  </code></pre>
  
  <p>UPDATE:  FIGURED IT OUT.  Never expected that the /sysBuilds directory needed execute perms to allow the file() method to run.  Thanks!</p>