Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Install apc on mac os X. Works in Mavericks!
#!/bin/bash
echo '===> install apc.so in OSX Mavericks'
mkdir -p ~/tmp/apc-deps
# Compile PCRE - Perl Compatible Regular Expressions
cd ~/tmp/apc-deps
curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.33.tar.gz
tar -xvzf pcre-8.33.tar.gz
cd pcre-8.33
./configure
make
sudo make install
HAVE_AUTOCONF=$(which autoconf)
if [[ $HAVE_AUTOCONF == "" ]] ; then
echo '===> no autoconf found'
echo '===> trying to install it...'
cd ~/tmp/apc-deps
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
else
echo '===> autoconf found'
fi
echo '===> Now get apc and installed it'
# Compile PHP APC
cd ~/tmp/apc-deps
curl -O http://pecl.php.net/get/APC-3.1.13.tgz
tar zxvf APC-3.1.13.tgz
cd APC-3.1.13
phpize
./configure --with-php-config=/usr/bin/php-config
make && sudo make install
echo '===> Done!. Modify your php.ini to load the apc.so. See the logs to find the proper location.'
echo '===> usually it is something like this... /usr/lib/php/extensions/no-debug-non-zts-20100525/'
@royriojas

This comment has been minimized.

Show comment Hide comment
@royriojas

royriojas Dec 12, 2013

xcode-select --install may be required.

Owner

royriojas commented Dec 12, 2013

xcode-select --install may be required.

@mcspronko

This comment has been minimized.

Show comment Hide comment
@mcspronko

mcspronko May 13, 2015

thank you for sharing. It works for me.

thank you for sharing. It works for me.

@sandroconte

This comment has been minimized.

Show comment Hide comment
@sandroconte

sandroconte Nov 21, 2015

thanks a lot

thanks a lot

@kevin-bruton

This comment has been minimized.

Show comment Hide comment
@kevin-bruton

kevin-bruton Mar 30, 2016

Link broken:
curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.33.tar.gz

Link broken:
curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.33.tar.gz

@craigstanton

This comment has been minimized.

Show comment Hide comment
@craigstanton

craigstanton Dec 14, 2016

The make command at the end fails for me in El Capitan

APC-3.1.13/apc_compile.c:2379:14: error: no member named 'function' in 'struct _zend_trait_alias'

The make command at the end fails for me in El Capitan

APC-3.1.13/apc_compile.c:2379:14: error: no member named 'function' in 'struct _zend_trait_alias'

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