0

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

3
  • Check the previous version of the config file...you did have it in version control, right? :) Aug 30, 2013 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, 2013 at 2:03
  • yum install etckeeper. You won't regret it. Aug 30, 2013 at 2:04

1 Answer 1

0

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
5
  • 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, 2013 at 2:04
  • can you post output of php -m?
    – skrewler
    Aug 30, 2013 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, 2013 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, 2013 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, 2013 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .