Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

PHP APC Install -- REVISED -- OSX Server v10.6 Snow Leopard

This information has been derived from a post from 2004 found HERE.

Credit goes to Timothy Gurske

I've made a couple changes based on what I had to do for it to work on my machine.

First I installed Xcode (yes it's necessary).

Then I installed PCRE because APC needs it to compile properly:

// ssh into your server as root or open terminal from the server

// Make a work directory on the root directory of your drive.
mkdir -p /SourceCache

// Go into that directory.
cd /SourceCache

// Download the new software.
curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.11.tar.gz

// Uncompress it.
tar xzf pcre-8.11.tar.gz

// Go into the new directory.
cd /SourceCache/pcre-8.11

// Prepares for compiling?
./configure --prefix=/usr/local

// This is where Xcode is necessary, "make" and "make install"
// will not work without Xcode
// here I also added the sudo prefix
sudo make

// sudo prefix was again necessary for my install
sudo make install


Then I compiled APC:

// Go back to the work directory.
cd /SourceCache

// Download APC, new version has simplified url
curl -O http://pecl.php.net/get/APC

// Uncompress it. make sure the file name is only "APC"
tar xzf APC

// Go the the appropriate directory.
cd /SourceCache/APC-3.1.7/

// Make the files appropriate for PHP compiling (I think that's what this does)
// add sudo for good measure.
sudo phpize

// Compile it for a snow leopard server 64 bit intel system.
// This should be one line, no returns. just copy and paste!
MACOSX DEPLOYMENTTARGET=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 atload" ./configure

// again sudo for kicks
sudo make

// sudo all day long
sudo make install

// If everything worked properly add this line to your /etc/php.ini file.
extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so

//or I just added the following shorthand version
extension=apc.so

// restart apache.
sudo apachectl graceful

Then test a phpinfo.php file and search for APC (should be just under HTTP Headers Information section. If it shows the apc section it's working!

Let me know if anyone has troubles.

Message was edited by: waterEngine

Mac Mini Server; MacBook Pro 15", Mac OS X (10.6.5)

Posted on Jan 13, 2011 11:50 AM

Reply

There are no replies.

PHP APC Install -- REVISED -- OSX Server v10.6 Snow Leopard

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.