1. 安装 php
brew install php55 --with-imap --with-tidy --with-debug --with-pgsql --with-mysql --with-fpm --with-gd=/usr/local/Cellar/gd --with-zlib --with-libpng --with-jpeg=/usr/local/Cellar/jpeg --with-freetype-dir=/usr/local/Cellar/freetype/2.6_1 --with-ttf --with-xpm --enable-gd-native-ttf
2. 安装 pecl
cd /usr/lib/php
sudo php install-pear-nozlib.phar
Edit:
vi /etc/php.ini and find the line: ;
include_path = “.:/php/includes”
修改为:
include_path = “.:/usr/lib/php/pear”
sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade-all
3. 安装oci8
3.1 安装oracle客户端
下载:
都解压复制到:
/opt/oracle/instantclient_11_2
cd /opt/oracle/instantclient_11_2
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
设置环境变量
export DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2:$DYLD_LIBRARY_PATH
export PATH=/opt/oracle/instantclient_11_2:$PATH
3.2 pecl 安装oci8
pecl install oci8
最后在php.ini文件中加入
extension=oci8.so
4. 安装其它插件
4.1正常安装
pecl install memcache
pecl install redis
pecl install mongo
4.2 安装 imagick
brew install imagemagick
brew install pkg-config
pecl install imagick
4.3 配置php.ini
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
extension = "memcache.so"
extension = "pdo_mysql.so"
extension = “imagick.so"--
extension = “xhprof.so”--
extension = "redis.so"
extension = "scws.so"
extension = "mongo.so"
extension = "zip.so"
extension = "taint.so"
extension = "xxtea.so"
extension = "yaf.so"
extension = "msgpack.so"
extension = "libevent.so"
extension = "apns.so"
extension = "uuid.so"
scws.default.fpath = /usr/local/scws/etc
xhprof.output_dir=/data0/www/html/gonghui/data/log/xhprof
5. 安装nginx
brew install nginx
6. 启动php
php-fpm --fpm-config /usr/local/etc/php-fpm.conf
7. 启动nginx
启动/停止:
/usr/local/bin/nginx -c /usr/local/etc/nginx/nginx.conf -s reload/reopen/quit/stop