Installing the PHP "memcached" Extension on OS X MAC
To disable System Integrity Protection, boot into recovery mode by restarting and then holding ⌘R as you hear the startup chime. Then start the Terminal from the Utilities menu.Run the following command
$ csrutil disableThen reboot. You are good to go.If you wish to turn it back on, which you probably should when you are done, follow the instructions above but instead use:
$ csrutil enableThe first step is to install the latest and greatest Xcode.Install the Xcode developer tools. Apple seems to have removed this option from the preferences so you'll need to handle this from the command line.
$ xcode-select --installNext we will install the required dependencies. If you are not already using Homebrew you should be.
$ brew install wget autoconf pkg-config libmemcachedYou will also want to make sure you have PEAR installed; instructions can be found here but can be summarized as follows:
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.pharThen in the /tmp directory we will create a folder we can work in.
$ cd /tmp
$ mkdir memcached-work
$ cd memcached-workThen we will use pecl, part of pear, to fetch the current version of the extension. The version of the memcached extension will vary so you may need to update your paths accordingly.
$ pecl download memcached
$ open memcached-{{version}}.tgz
$ cd memcached-{{version}}/memcached-{{version}}
$ phpize
$ ./configure
$ make
$ sudo make installFinally you will need to add the following line to your php.ini
extension = memcached.soYou can verify your installation with the following:
$ php --info | grep memcached\\.Depending on your setup now you may want to restart apache.
$ sudo apachectl restartYou should be all set to go! Godspeed.