Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am using nginx with php-fpm (on centos) and a while ago i found a variable in one of the various config files that determines whether the server checks for the existence and/or change status of each of the served php files (as i comprehend what was occurring there). i read that one setting increases server performance and so i chose that setting. i found i needed to restart php-fpm service manually for changes that i made to my website's code to be picked up by nginx and served.

i recently upgraded php and this setting is no longer as it was and i am not recalling what the parameter name/token is.. so i am not able to re-activate it. does anyone know what the variable is? thanks

share|improve this question
    
Check the previous version of the config file...you did have it in version control, right? :) –  Michael Hampton Aug 30 '13 at 1:41
    
no version control, no. ;) the upgrade process asked me to compare or replace the various php config files and i carefully compared them line by line. i continue! –  tunist Aug 30 '13 at 2:03
    
yum install etckeeper. You won't regret it. –  Michael Hampton Aug 30 '13 at 2:04
    
ah nice. thanks for the tip. :) –  tunist Aug 30 '13 at 2:10
add comment

1 Answer

You're probably thinking of the "stat" setting in apc. It's located in /etc/php.d/apc.ini or /etc/php/conf.d/apc.ini depending on your distro.

You want to have apc.stat=1 to make it check for file modifications, as you said it will result in a significant performance loss, so you should keep it disabled in production.

See http://www.php.net/manual/en/apc.configuration.php#ini.apc.stat for more info.


For newer PHP versions using OPcache, the setting you want to enable is validate_timestamps in your opcache.ini. You'll also then need to set revalidate_freq to how often you want it to check for modifications. A setting of 0 would make it check every request.

So,

opcache.validate_timestamps=1
opcache.revalidate_freq=0
share|improve this answer
    
hmm.. possibly.. i read that php 5.5 uses opcache and that apc is best disabled now. maybe i need to read more about opcache. –  tunist Aug 30 '13 at 2:04
    
can you post output of php -m? –  skrewler Aug 30 '13 at 10:36
    
you didn't specify which version of php you were using.. updated my answer with the equivalent setting in opcache –  skrewler Aug 30 '13 at 10:41
    
php -m = [PHP Modules] apc apcu bcmath bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv igbinary imagick json ldap libxml mbstring mcrypt memcache memcached mhash mongo mysql mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_pgsql pdo_sqlite pgsql Phar posix readline recode Reflection session shmop SimpleXML sockets SPL SQLite sqlite3 standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xdebug xml xmlreader xmlwriter xsl zip zlib [Zend Modules] Xdebug –  tunist Aug 30 '13 at 19:50
    
php version = 5.5.3 i already downloaded the gist info page from here: gist.github.com/ck-on/4959032/?ocp.php i notice opcode is not activated there. and so far i have not seen it say 'enabled' there for opcode, despite me having gone through all the steps in various walkthroughs to activate opcode caching. –  tunist Aug 30 '13 at 19:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.