Nginx+PHP

#PHP

whck6

Install Commandline Tools

xcode-select --install

Install Nginx

brew update

After install run

sudo nginx

Configuration

/usr/local/etc/nginx/nginx.conf

top nginx service

sudo nginx -s stop

Reload nginx service

sudo nginx -s reload

Nginx.conf

vim /usr/local/etc/nginx/nginx.conf

    server {
        listen       8080;
        server_name  localhost;

        root   html;

        location / {
            try_files index.html /index.php;
        }
        
        location ~ \.php$ {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include       fastcgi_params;
        }
        
        location ~ /\.ht {
            deny  all;
        }
    }

Install PHP5.6

brew tap homebrew/homebrew-php
brew install --without-apache --without-fpm --without-mysql php56

php-fpm

php-fpm
[18-Dec-2017 16:51:20] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[18-Dec-2017 16:51:20] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root

sudo php-fpm

https://gist.github.com/dtomasi/ab76d14338db82ec24a1fc137caff75b