1.安装GD库:
- 原有php(php5.2)在安装GD时没有编译freetype,造成与生成图片相关的函数无法使用。
- brew rm freetype jpeg libpng gd zlib
- brew install freetype jpeg libpng gd zlib
- 中间可能会提示/usr/local无写权限,给local目录777权限或者757
- 创建链接 brew link --overwrite libpng freetype jpeg
- brew install php55 (安装php5.5)
- 替换
LoadModule php5_module libexec/apache2/libphp5.so 为
LoadModule php5_module /usr/local/Cellar/php55/5.5.30/libexec/apache2/libphp5.so
- 此时配置文件在: /usr/local/etc/php/5.5/php.ini
- 中间可能会提示configure: error: Cannot find libz ,解决办法 xcode-select install
2.安装memcached
- brew install memcached
- brew install php55-memcached
- extension=memcached.so
3.安装redis
- brew install redis
- brew install php55-redis
- extension=redis.so
- redis会用到序列化工具 igbinary,所以在安装之前需要安装igbinary。否则会报 No such file or directory - /usr/local/opt/igbinary/include/igbinary.h
- brew install igbinary
- brew install php55-igbinary
- extension=igbinary.so