Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Install PHP APC on Mac OS X 10.8 "Mountain Lion"
# Compile PCRE - Perl Compatible Regular Expressions
cd /usr/local/src
curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.31.tar.gz
tar -xvzf pcre-8.31.tar.gz
cd pcre-8.31
./configure
make
sudo make install
# Compile Autoconf
cd /usr/local/src
curl -O http://gnu.mirrors.hoobly.com/gnu/autoconf/autoconf-2.69.tar.gz
tar xzf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr/local
make
sudo make install
# Compile PHP APC
cd /usr/local/src
curl -O http://pecl.php.net/get/APC-3.1.13.tgz
tar xzf APC-3.1.13.tgz
cd APC-3.1.13
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config
make && sudo cp modules/*.so /usr/lib/php/extensions/no-debug-non-zts-20090626
@julienbourdeau

This comment has been minimized.

Show comment Hide comment
@julienbourdeau

julienbourdeau Mar 25, 2013

How come there is no "make install" after you "configure" and "make" PHP APC?

How come there is no "make install" after you "configure" and "make" PHP APC?

@wildone

This comment has been minimized.

Show comment Hide comment
@wildone

wildone Apr 23, 2013

because they are modules...read line 26...

wildone commented Apr 23, 2013

because they are modules...read line 26...

@BognarB

This comment has been minimized.

Show comment Hide comment
@BognarB

BognarB May 23, 2013

use APC-3.1.9 is last stable version at this moment

BognarB commented May 23, 2013

use APC-3.1.9 is last stable version at this moment

@brod-ie

This comment has been minimized.

Show comment Hide comment
@brod-ie

brod-ie Jul 3, 2013

@BognarB is indeed correct, 3.1.9 is the latest stable version: http://pecl.php.net/package/APC. Thanks for the Gist, it worked a treat.

brod-ie commented Jul 3, 2013

@BognarB is indeed correct, 3.1.9 is the latest stable version: http://pecl.php.net/package/APC. Thanks for the Gist, it worked a treat.

@salamoun

This comment has been minimized.

Show comment Hide comment
@salamoun

salamoun Jul 5, 2013

Works on 10.9 Mavericks (with Xcode 5) too.

salamoun commented Jul 5, 2013

Works on 10.9 Mavericks (with Xcode 5) too.

@kevindees

This comment has been minimized.

Show comment Hide comment
@kevindees

kevindees Aug 8, 2013

pcre needs to be 8.33

pcre needs to be 8.33

@mizterp

This comment has been minimized.

Show comment Hide comment
@mizterp

mizterp Jan 13, 2014

I had to use the following to get APC installed on my system:

[path_to_php]/bin/phpize && CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure --with-php-config=[path_to_php]/bin/php-config && make

mizterp commented Jan 13, 2014

I had to use the following to get APC installed on my system:

[path_to_php]/bin/phpize && CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure --with-php-config=[path_to_php]/bin/php-config && make

@ruby-zhang

This comment has been minimized.

Show comment Hide comment
@ruby-zhang

ruby-zhang Mar 10, 2014

/usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found

/usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found

@ddimaria

This comment has been minimized.

Show comment Hide comment
@ddimaria

ddimaria Apr 4, 2014

Latest PCRE is 8.35. Change lines 3-5 to read:

curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.35.tar.gz
tar -xvzf pcre-8.35.tar.gz
cd pcre-8.35

ddimaria commented Apr 4, 2014

Latest PCRE is 8.35. Change lines 3-5 to read:

curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.35.tar.gz
tar -xvzf pcre-8.35.tar.gz
cd pcre-8.35

@g-patel

This comment has been minimized.

Show comment Hide comment
@g-patel

g-patel Jun 11, 2015

this is not related to "Mountain Lion", but any idea to installing apc on " Os X Yosemite" which comes with php 5.5?

g-patel commented Jun 11, 2015

this is not related to "Mountain Lion", but any idea to installing apc on " Os X Yosemite" which comes with php 5.5?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment