Skip to content

Instantly share code, notes, and snippets.

@bcremer
Last active September 9, 2020 21:03
Show Gist options
  • Save bcremer/5450321 to your computer and use it in GitHub Desktop.
Save bcremer/5450321 to your computer and use it in GitHub Desktop.
Alternative Bytecodecache + Datacache based on ZendOpcache and APCu
# 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
@skl
Copy link

skl commented Aug 22, 2013

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