I've been struggling with this all night and can't find an answer that fixes it!
I'm on a mac and using homebrew to install php and nginx, I ran the following which show as successful
brew install php brew install nginx
no problems so far and I can start both services
brew services start nginx brew services start nginx
when I run brew services list I get the following
nginx started me /Users/me/Library/LaunchAgents/homebrew.mxcl.nginx.plist php started me /Users/me/Library/LaunchAgents/homebrew.mxcl.php.plist
however when trying to run a Wordpress site I get the following error in my nginx log
[error] 26099#0: *1 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080"
I have googled the problem and it seems that it's normally a problem with nginx passing a request to php-fpm, I have checked the user that is running each service to make sure they match, I have done it as both me and both root to no avail. When I check "brew services list" it shows php in orange which I understand to mean it has actually failed.
I dug a bit further and it seems that if I run 'php -v' I get
PHP 7.2.9 (cli) (built: Aug 23 2018 02:08:27) ( NTS )
but if I run 'php-fpm -v' I get:
PHP 7.1.16 (fpm-fcgi) (built: Mar 31 2018 03:00:16)
I believe this is causing me a problem, I have googled it but haven't got any definitive fixes.
Here is another oddity with it:
$which php /usr/local/bin/php $which php-fpm /usr/sbin/php-fpm
Does anyone have any ideas how I can resolve this?
Thanks in advance!