title: php -v and php-fpm -v show different versions of php
body: <p>I've been struggling with this all night and can't find an answer that fixes it! </p>
  
  <p>I'm on a mac and using homebrew to install php and nginx, I ran the following which show as successful</p>
  
  <pre><code>brew install php
  brew install nginx
  </code></pre>
  
  <p>no problems so far and I can start both services </p>
  
  <pre><code>brew services start nginx
  brew services start nginx
  </code></pre>
  
  <p>when I run brew services list I get the following</p>
  
  <pre><code>nginx started me /Users/me/Library/LaunchAgents/homebrew.mxcl.nginx.plist
  php   started me /Users/me/Library/LaunchAgents/homebrew.mxcl.php.plist
  </code></pre>
  
  <p>however when trying to run a Wordpress site I get the following error in my nginx log</p>
  
  <pre><code>[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"
  </code></pre>
  
  <p>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. </p>
  
  <p>I dug a bit further and it seems that if I run 'php -v' I get </p>
  
  <pre><code>PHP 7.2.9 (cli) (built: Aug 23 2018 02:08:27) ( NTS )
  </code></pre>
  
  <p>but if I run 'php-fpm -v' I get: </p>
  
  <pre><code>PHP 7.1.16 (fpm-fcgi) (built: Mar 31 2018 03:00:16)
  </code></pre>
  
  <p>I believe this is causing me a problem, I have googled it but haven't got any definitive fixes. </p>
  
  <p>Here is another oddity with it: </p>
  
  <pre><code>$which php
  /usr/local/bin/php
  $which php-fpm
  /usr/sbin/php-fpm
  </code></pre>
  
  <p>Does anyone have any ideas how I can resolve this? </p>
  
  <p>Thanks in advance! </p>