Skip to content

Instantly share code, notes, and snippets.

@t0mtaylor
Forked from bcremer/ZendOpcache + APCu
Created July 14, 2014 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t0mtaylor/9bfcb3b84d39a57f4151 to your computer and use it in GitHub Desktop.
Save t0mtaylor/9bfcb3b84d39a57f4151 to your computer and use it in GitHub Desktop.
# http://pecl.php.net/package/APCu
# http://pecl.php.net/package/ZendOpcache
# Install ZendOpcache
sudo pecl install ZendOpcache-beta
sudo -i
cat > /etc/php5/mods-available/opcache.ini << EOF
zend_extension=/usr/lib/php5/20100525/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1
EOF
ln -s /etc/php5/mods-available/opcache.ini /etc/php5/conf.d/20-opcache.ini
# Install APCu
APC compatibility is broken in the 4.0.1 pecl release. See:
https://github.com/krakjoe/apcu/issues/15
git clone https://github.com/krakjoe/apcu.git
cd apcu
pecl package package.xml
sudo pecl install -f apcu-4.0.2.tgz
echo "extension=apcu.so" > /etc/php5/mods-available/apcu.ini
ln -s /etc/php5/mods-available/apcu.ini /etc/php5/conf.d/20-apcu.ini
# Regular APCu install (Use when 4.0.2 is released)
sudo pecl install APCu-beta
sudo -i
echo "extension=apcu.so" > /etc/php5/mods-available/apcu.ini
ln -s /etc/php5/mods-available/apcu.ini /etc/php5/conf.d/20-apcu.ini
@t0mtaylor
Copy link
Author

TODO:

extension="apcu.so"
apc.serializer=php ; See bug report for more info: http://ey.io/1aJhcOY
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 128M
apc.max_file_size = 2M
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 1024
apc.enable_cli=0

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