title: Access to the script '/path/to/script.php' has been denied (see security.limit_extensions)
body: <p>before let me list what I have tried:</p>
  
  <ul>
  <li><a href="https://serverfault.com/questions/402009/fastcgi-error-access-to-the-script-denied">This Answer on ServerFault</a></li>
  <li>chmoded /Users/user/portal3 to 777 to see if executes</li>
  <li>Created two pools one with root and another with current user</li>
  <li>googled </li>
  <li>entered ##php in freenode </li>
  <li>and lot of other ideas.</li>
  </ul>
  
  <p>i have a problem executing php code on a subdirectory inside my home directory.
  On Nginx i get this</p>
  
  <pre><code>2016/08/23 09:13:40 [error] 39170#0: *13 FastCGI sent in stderr: "Access to the script 
  '/Users/user/portal3' has been denied (see security.limit_extensions)" while reading
  response header from upstream, client: 127.0.0.1, server: localhost, request:
  "GET /portal/v3/index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "localhost"
  </code></pre>
  
  <p>On php-fpm this shows </p>
  
  <pre><code>[23-Aug-2016 09:13:40] WARNING: [pool dev] child 8305 said into stderr: "NOTICE: Access to the script '/Users/user/portal3' has been denied (see security.limit_extensions)"
  </code></pre>
  
  <p>I have tried everything but I don't have any success running php with Nginx / PHP-FPM on Mac</p>
  
  <p>Ngnix adn PHP-FPM runs as root</p>
  
  <p>PHP-FPM it's configured with two pools:</p>
  
  <ul>
  <li>[www]: run as root and works fine, execute php code but their www-root subdirectory is in /var/www</li>
  <li>[dev] pool that runs as my current user on MacOS X, listen on port 9001, and is configured to run code in /Users/user/portal3.</li>
  </ul>
  
  <h2>php-fpm.ini</h2>
  
  <pre><code>[dev]
  user=user
  group=staff
  listen=127.0.0.1:9001
  listen.mode = 0666
  pm = ondemand
  pm.max_children = 10
  pm.process_idle_timeout = 10s
  pm.status_path = /status_user
  catch_workers_output = yes
  security.limit_extensions = .php
  </code></pre>
  
  <h2>default (on sites-available) Nginx</h2>
  
  <pre><code>server {
      listen       80;
      server_name  localhost;
      ###root /var/www/;
      access_log   /usr/local/etc/nginx/logs/default.access.log  main;
      access_log   /usr/local/etc/nginx/logs/default.scripts.log  scripts;
  
      location /portal/v3 {
          alias /Users/user/portal3;
          location ~  ^/portal/v3/(.+\.php)(/.*)$ {
              #alias /Users/user/portal3;
              index index.php;
  
              # Mitigate https://httpoxy.org/ vulnerabilities
              fastcgi_param HTTP_PROXY "";
  
              fastcgi_pass   127.0.0.1:9001;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME $document_root$2;#$fastcgi_script_name;
              include fastcgi_params;
          }
  
      }
  
      location = /info {
          allow   127.0.0.1;
          deny    all;
          rewrite (.*) /.info.php;
      }
  
      location / {
          root /var/www/;
          index        index.php index.html index.htm;
          include   /usr/local/etc/nginx/conf.d/php-fpm;
      }
  
      error_page  404     /404.html;
      error_page  403     /403.html;
  }
  </code></pre>
  
  <p>i have installed everything using homebrew. Now i'm running out of ideas, i came here to get some help.</p>