PHP-FPM and OpCache - but enabled for specific domains

MartijnB

New member
Joined
Oct 24, 2013
Messages
3
I got a fresh DA installation with custombuild 2.0 ( upgraded from 1.x )
with Apache + php-fpm for PHP5.3 and 5.4.

I got OpCache (Zend Optimizer plus) installed, steps are allmost the same as APC.
My question is not about the installation but my solution in enabling OpCache for specific domains.
I am doing one thing that seems to be undocumented. ( i can't find it )

First my install steps:
Code:
# cd /usr/local/directadmin/custombuild
# wget -O ZendOptimizerPlus-7.0.2.tar.gz https://github.com/zendtech/ZendOptimizerPlus/archive/v7.0.2.tar.gz
# tar -xvf ZendOptimizerPlus-7.0.2.tar.gz
# cd ZendOptimizerPlus-7.0.2
# /usr/local/php53/bin/phpize53
# ./configure --with-php-config=/usr/local/php53/bin/php-config53
# make
# make install 
Output: [code]Installing shared extensions:     /usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626/
[/code]

And activate OpCache:
Code:
# nano /usr/local/php53/lib/php.conf.d/opcache.ini
Contents:
Code:
zend_extension=/usr/local/php53/lib/php/extensions/no-debug-non-zts-20090626/opcache.so

php_admin_flag opcache.enable off
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=0

Restart php-fpm and apache:
Code:
# service php-fpm53 restart
# service httpd restart

At this point OpCache is included in php-fpm53. But its disabled by default.
And now enabling it for a domain ( user in this case) :
Code:
# nano /usr/local/directadmin/data/users/[username]/php/php-fpm53.conf
Add:
Code:
php_admin_flag[opcache.enable] = on

As you can see i'm using "php_admin_flag" in file "opcache.ini".
This is the only way i was able to enable OpCache for a domain. It seems an undocumented feature, or am i missing something?
Feedback on installing OpCache is also welcome...
 
Back
Top