1

I am tying to update the PHP on my Mac OS X machine from 5.4 to 5.6. I am using Homebrew. I installed PHP 5.6 using Homebrew successfully: brew install php56.

However, when I rebooted the Unix shell, and typed the command php -v, it still shows PHP 5.4.10.

I ran: export PATH="$(brew --prefix homebrew/php/php56)/bind:$PATH".

However, the php -v has not changed to 5.6. What can I do to get my system to use 5.6?

halfer
  • 19,824
  • 17
  • 99
  • 186
user1072337
  • 12,615
  • 37
  • 116
  • 195
  • 1
    Verify what PHP you are using with `which php`. Then inspect your `PATH` - `echo $PATH`. The path order of your path matters, and your system will run the first PHP executable it finds. – Darragh Enright Aug 21 '15 at 21:01
  • This covers it pretty well: http://stackoverflow.com/questions/20523183/how-to-use-the-php-that-brew-installed – ficuscr Aug 21 '15 at 21:07
  • I changed the module and restarted apache, but when running php -v I'm still getting php 5.4. Running "which php", I get: /Applications/MAMP/bin/php/php5.4.10/bin/php. How do I change these path? – user1072337 Aug 21 '15 at 21:48

1 Answers1

0

Mac OSX has an own php installed. The same for Python and Ruby. With Homebrew, you installed a new/extra version of php (not an update of the pre-installed version) which runs perfect separately.

The php command points to the native Mac OSX php. If you run Homebrew, the webserver will use his own php version.

schellingerht
  • 5,726
  • 2
  • 28
  • 56