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

Install PHP APC

Hi,

I want to install APC on my server but I can't seem to find a good tutorial how to

Is there anyone who can help me out?

Thnx

Mac Mini, Mac OS X (10.6.2)

Posted on Jun 2, 2010 6:01 AM

Reply
8 replies

Jun 18, 2010 2:02 AM in response to Interactive

I am also looking to install APC. I installed macports and it seems to work but I would rather use the apple version of everything if possible. I found this: http://discussions.apple.com/thread.jspa?messageID=10106396 which shows how to install gettext but I'm not sure how to change this code to get me going with APC. Any suggestions? Pterobyte, can you help?

Thanks!

Jun 18, 2010 3:07 PM in response to Interactive

Ok, here is what I did to install the Alternative PHP Cache (APC) on a Mac Mini Server running 10.6.4:

*First I installed X11 (not sure if this is necessary) and Xcode. This enables me to compile.*

*Then I installed PCRE because APC needs it to compile properly:*
Thanks go here for this part: http://www.kevinworthington.com/nginx-mac-os-snow-leopard-2-minutes/

// ssh into your server as root

// 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.01.tar.gz

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

// Go into the new directory.
cd pcre-8.01

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

make

make install



*Then I compiled APC:*
Thanks go to pterobyte for leading me in the right direction for this part.

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

// Download APC.
curl -O http://pecl.php.net/get/APC-3.1.3p1.tgz

// Uncompress it.
tar xzf APC-3.1.3p1.tgz

// Go the the appropriate directory.
cd /SourceCache/APC-3.1.3p1/

// Make the files appropriate for PHP compiling (I think that's what this does).
phpizeConfiguring

// Compile it for a snow leopard server 64 bit intel system. This should be one line, no returns.
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

make

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

// restart apache.
sudo apachectl graceful

Then test a phpinfo.php file and search for APC. If it shows up it's working!

Please post if I missed or am misstating something.

Install PHP APC

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