Stop php, still php

(Marcos) #1

Hi there community,
I’m kind of new to brew. The thing is if i stop php brew services stop php@7.2 if i go php -v i still get the:
PHP 7.2.15 (cli) (built: Feb 7 2019 20:11:08) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.15, Copyright (c) 1999-2018, by Zend Technologies

No difference, do i have more than one PHP installed?

How can i fix this?

0 Likes

(Sean Molenaar) #2

One is the php service and the other is the cli. If you want to get rid of php you’ll have to use brew uninstall php@7.2

1 Like

(Envy3000) #3

I guess you’ve got 2 php versions installed on your mac. Just like Apache, OSX contains also php by factory settings, and when you run “brew install php” you’ll add the second one. The “php -v” or “httpd -v” command often displays the OSX php specs.

Default osx apache path: /etc/apache2/httpd.conf
Homebrew apache path: /usr/local/etc/httpd/httpd.conf
You can test this to type in terminal : which -a apachectl
That sums up the apaches installed and regarding php, you can do the same:

Just type in terminal : which -a php
My mac shows:
/usr/bin/php
/usr/local/bin/php

To stop the apache by apple version: sudo /usr/sbin/apachectl stop
To start the brew apache: sudo /usr/local/bin/apachectl start

php stop/start are probably alike the apache ones, havn’t done that.

And to show the php versions just use this:

Terminal input: /usr/bin/php -v
shows the OSX build in version:
PHP 5.6.30 (cli) (built: Oct 29 2017 20:30:32)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies

And terminal input: /usr/local/bin/php -v
Will show the brew version:
PHP 7.3.2 (cli) (built: Feb 14 2019 10:09:47) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.3.2, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.3.2, Copyright © 1999-2018, by Zend Technologies

0 Likes