Skip to content

Instantly share code, notes, and snippets.

@justinharringa
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinharringa/b31b064c580a9e4af8e3 to your computer and use it in GitHub Desktop.
Save justinharringa/b31b064c580a9e4af8e3 to your computer and use it in GitHub Desktop.

PHP Install on a Mac

PEAR

  1. Install PEAR in /usr/local

     cd /usr/local
     curl http://pear.php.net/go-pear.phar
    
  2. If you don't already have a php.ini

     sudo cp /etc/php.ini.default /etc/php.ini
    
  3. Check your pear directory using

     pear config-get php_dir
    
  4. Make sure your pear directory is in your php.ini includes

     include_path = "/usr/local/share/pear:.:/php/includes"
    
  5. Check installation

Composer

Composer Installation

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

PHPUnit

Getting Started

  1. Install
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
phpunit --version
  1. Add phpunit to /etc/php.ini
  2. Use custom autoloader in IntelliJ's PHPUnit Preferences
  • Set the path to /usr/local/bin/phpunit

Xdebug

brew tap josegonzalez/homebrew-php
brew install php55-xdebug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment