How to configure zend opcache? php7

Discussion in 'Installation/Configuration' started by mart28, Nov 8, 2016.

  1. mart28

    mart28 New Member

    Hi.I use debian 8 with ispconfig3.
    I have updated php 7 following this tutorial.
    https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
    I wanted to configure zen opcacheIn other posts and pages I read the following

    Then I created a file opcache.ini on /etc/php5/conf.d with this config:
    zend_extension=/usr/lib/php5/20100525/opcache.so (changed with my config)
    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

    Or on this route


    /etc/php5/apache2/php.ini
    /etc/php5/cgi/php.ini


    In this route
    /opt/php-7.0.7
    Here, It dont have apache folder



    I have read here https://community.1and1.com/php-7/


    adjust the php.ini

    Open the root folder of your website using SFTP.
    Open the php.ini file.
    Add this content to your php.ini:

    zend_extension=opcache.so;
    opcache.enable=1;opcache.memory_consumption=32;
    opcache.interned_strings_buffer=8;
    opcache.max_accelerated_files=3000;
    opcache.revalidate_freq=180;
    opcache.fast_shutdown=0;
    opcache.enable_cli=0;
    opcache.revalidate_path=0;
    opcache.validate_timestamps=2;
    opcache.max_file_size=0;
    opcache.file_cache= .../homepages/mypath/htdocs/.opcache;
    opcache.file_cache_only=1;

    If I look for my php.ini when I run php 7

    Configuration File (php.ini) Path /opt/php-7.0.7/lib
    Loaded Configuration File /opt/php-7.0.7/lib/php.ini


    I have written at the end, by default the following lines



    ; Local Variables:
    ; tab-width: 4
    ; End:
    zend_extension=opcache.so
    set cgi.fix_pathinfo = 0




    sudo find / -name 'opcache.so'
    /usr/lib/php5/20131226/opcache.so
    /usr/local/src/php5-build/php-7.0.7/ext/opcache/.libs/opcache.so
    /usr/local/src/php5-build/php-7.0.7/modules/opcache.so
    /opt/php-7.0.7/lib/php/extensions/no-debug-non-zts-20151012/opcache.so

    I set it up like that



    zend_extension=/opt/php-7.0.7/lib/php/extensions/no-debug-non-zts-20151012/opcache.so

    opcache.enable=1;opcache.memory_consumption=32;
    opcache.interned_strings_buffer=8;
    opcache.max_accelerated_files=3000;
    opcache.revalidate_freq=180;
    opcache.fast_shutdown=0;
    opcache.enable_cli=0;
    opcache.revalidate_path=0;
    opcache.validate_timestamps=2;
    opcache.max_file_size=0;
    opcache.file_cache= /var/www/cachezen;
    opcache.file_cache_only=1;

    set cgi.fix_pathinfo = 0



    If I write the above below a php ini shows me the following


    Zend OPcache
    Opcode Caching Up and Running
    Optimization Enabled
    SHM Cache Enabled
    File Cache Disabled
    Startup OK


    Where should I write the configuration?
    Thank you
     
  2. mart28

    mart28 New Member

    I solve it by giving 777 permission to the folder cachezen, and restar server.
     
  3. quanghnn

    quanghnn New Member

    I haven't seen this problem
     

Share This Page