Skip to content

Instantly share code, notes, and snippets.

@augustohp
Created August 7, 2011 23:56
Show Gist options
  • Save augustohp/1130950 to your computer and use it in GitHub Desktop.
Save augustohp/1130950 to your computer and use it in GitHub Desktop.
APC installation for OSX
#!/bin/bash
#
# Downloads and install latest APC extension to OSX php (Zend Server).
# Tested under OSX 10.6.7, more feedback is appreciated.
#
# OSX is 64bit but the PHP binary in Zend Server is compiled in 32bit mode only,
# so to have APC working with Zend Server on OSX statically compiling it with default
# recommended flags and forced i386 architecture.
# I suppose that Zend Server's binary path is already into your PATH variable and it
# is used before the native PHP binary bundled with OSX.
#
# Author: Augusto Pascutti <augusto [at] phpsp [dot] org [dot] br
cd /tmp
sudo pecl download apc
sudo mkdir PHP_APC
sudo tar -zxvf APC-*.tgz -C PHP_APC
cd PHP_APC/APC*
sudo phpize
sudo ./configure MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch i386 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -g -Os -pipe" CXXFLAGS="-arch i386 -g -Os -pipe" LDFLAGS="-arch i386 -bind_at_load" --enable-apc-debug=no --enable-apc-filehits=no --enable-apc-spinlocks=no --enable-apc-memprotect=no --enable-apc-pthreadmutex=yes --enable-apc-pthreadrwlocks=no
sudo make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment