Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Mac OSX 10.8.2. I'm also quite new to Mac OSX -- previously the only Mac I understood was the Classic Mac. My other workstations are Windows and Linux.

What's the technique to install PHP CLI on Mac OSX? See, I use gedit for Mac and connect to either an FTP location or to my local Ubuntu Linux Server in a VM. In that editor, there's a feature where I can add an external program, and a technique I usually use is to add "php -l", which lets me take the current document and lint check it against PHP CLI. I used to do this all the time on Ubuntu, but on the Mac I'm not certain how to install PHP CLI.

share|improve this question
up vote 5 down vote accepted

It should already be present. Typing php --version from a command line on a Mac OS X 10.8 install, i get:

merak:~ peelman$ php --version
PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

If you need other utilities, you should look at the Homebrew project.

share|improve this answer
Well I'll be dipped in.... Awesome! Thanks! :) – Volomike Jan 15 '13 at 3:52
thanks a lot :D – Harsha M V Jun 13 '14 at 6:09

You can also have a look at for an installer of the latest PHP versions for OS-X.

share|improve this answer

Check this link if you want to enable php-cli on MAMP. It worked for me pretty clean :)

The answer that worked for me :-

I had the same problem. Running MAMP on OS X Leopard Server. You need to point the system path to the MAMP php whereas now it's trying to use the default OS X install version issuing the command 'which php' at this point should show '/usr/bin/php' but we want this to point to our MAMP version instead

In terminal issue the following commands. This will rename the current OS X php to php-old, then create a new symbolic link (NOT an alias!) to the MAMP php version...

sudo mv /usr/bin/php usr/bin/php-old sudo ln -s /Applications/MAMP/bin/php5.3/bin/php usr/bin/php

which php *should now output /Applications/MAMP/bin/php5.3/bin/ You can now issue 'php -v' and you should see some output about the 5.3 version of php. Now the Kaltura install should see that php-cli is running.

If that does not work however, you can also update the php PATH in your user .profile with the following command: export PATH=/Applications/MAMP/bin/php5.3/bin:$PATH

which php *should now output /Applications/MAMP/bin/php5.3/bin/

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.