I currently using

php -S localhost:8000

for my php testing server on OS X.

I am trying to use OpenCart which requires mcrypt and OS X does not come with that.

I installed Homebrew, php 5.6.5, and mcrypt.

It still says that mcrypt is not on when I try to install Open Cart which requires that.

How can I be sure that the correct php version from Homebrew as well as mcrypt are linked properly?

In the past I manually installed MySQL and also tried to manually install php 5.6.5 to replace the version that came with OS X. The phpinfo(); page I made and the command line both state that I have version 5.6.5 so I am unsure if that is linked to Homebrew or to when I manually tried to install php 5.6.5.

Thank you

1 Answer 1


I'm not familiar with OpenCart but you should check you path and make sure the homebrew php is the default.

In the terminal:

$ which php
$ php -v
PHP 5.5.14 (cli) (built: Sep  9 2014 19:09:25) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

$ which mongod 
$ ls -al /usr/local/bin/mongod
lrwxr-xr-x  1  ----  admin  34 Dec  8 17:25 /usr/local/bin/mongod -> ../Cellar/mongodb/2.6.5/bin/mongod

In this example I've installed mongod from homebrew. I've never installed php but it looks like it exists on my system by default. I'm guessing your system is using the standard php and not the brew one.

Try running your server like this:

/usr/local/bin/php -S localhost:8000
  • Thank you very much for your help! I did not think to try and start the php server from a different location. Since I found that Homebrew installs to “/usr/local/Cellar”, I ran the php server by typing "/usr/local/Cellar/php56/5.6.5/bin/php -S localhost:8000”. The phpinfo(); displayed that I was on version 5.6 from homebrew as opposed to the version 5.5 that came with OS X. Changed the path by typing: export PATH=/usr/local/Cellar/php56/5.6.5/bin:"${PATH}” Now "php -S localhost:8000” runs the homebrew version of php I installed. Thank you very much again
    – AndrewMRiv
    Feb 13, 2015 at 16:36
  • Glad to help :) Feb 13, 2015 at 17:34
  • Remember to update your apache httpd.conf file when upgrading php and add this to your .zshrc / .bashrc file export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"and restart Apache with sudo apachectl restart
    – pixel 67
    Feb 20, 2015 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .