Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

3 Answers 3

up vote 3 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
1  
Well I'll be dipped in.... Awesome! Thanks! :) –  Volomike Jan 15 '13 at 3:52
1  
thanks a lot :D –  Harsha M V Jun 13 at 6:09

You can also have a look at http://php-osx.liip.ch 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

 
discard

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.