Simple enough with the right instructions - versions current as of late December 2010.
XCode and admin Required
Requires admin login.
Requires XCode tools to gain the ability to compile open source applications. XCode OS X development software is included with every copy of OS X, but not installed by default. Version 3.2.5 of XCode was used to compile in this instance.
Get the Files
PCRE is required in the APC compile, so it must be built and installed first.
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.11.tar.gz
http://pecl.php.net/get/APC-3.1.6
Configure, Build, Install
Create a workspace to extract the files.
~/Desktop/source was used in this case
Copy the downloaded files into the source directory.
Move into the source directory, build and install PCRE:
- # tar xzf pcre-8.11.tar.gz
- # cd pcre-8.11
- # ./configure --prefix=/usr/local
- # make
- # make install
Move back up one level into the source directory, build and install APC cache:
The configure options passed in step four are all one line.
- # tar xzf APC-3.1.6.tgz
- # cd APC-3.1.6/
- # phpize
- # MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure
- # make
- # make install
When the build is complete, tell php to load and use the apc extension by adding the following line, all on one line, to php.ini which is typically found in the /etc folder
- file.extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so
Restart apache and view the output of phpinfo() to verify APC cache is installed and working.
After the builds, drag the source folder to the trash to clean things up.
Hosting multiple sites on the same server, may require creating a site by site instance of APC cache by implementing a custom php.ini on site by site basis.
No bench testing or performance improvement details yet. Will get that up when time allows.
Original source for this info was Apple discussions: