How to install memcache.so/memcached.so for MAMP Pro (Mac)

Install memcache.so for PHP 5.6

 

1. Install memcached

2. Download php source code

http://www.php.net/downloads.php

 

3. Copy source code to the folder /Applications/MAMP/bin/php/{php version}/include/php

e.g.) /Applications/MAMP/bin/php/php5.6.10/include/php

 

4. Install libiconv

 

5. Execute configure in php source folder

 

6. Install zlib

 

7. Create link file for zlib

 

8. Use pecl to install memcache

 

9. Go to MAMP Pro -> File -> Edit Template -> PHP -> PHP 5.6.10

Add following lines to end of file

 

10. Restart services in MAMP

 

Install memcache.so for PHP 7.0

 

1. Re-install pkg-config (if get pkg-config error)

 

2. Download php.memcached and create memcache.so

9. Go to MAMP Pro -> File -> Edit Template -> PHP -> PHP 5.7.08

Add following lines to end of file

Note:

To use cache memcache in Yii2 + PHP7+, then set cache configuration as below:

 

 

Reference: