Welcome to Centmin Mod Community
Become a Member

PHP-FPM Enabling Opcache on php 5.5

Discussion in 'Centmin Mod Insights' started by Peter Downey, Jul 25, 2014.

  1. Peter Downey

    Peter Downey Member

    62
    23
    8
    May 28, 2014
    Ratings:
    +25
    Local Time:
    3:14 PM
    I wanted to enable zend opcache on php 5.5 and I wasn't sure if centminmod requires anything different to make this work. Is option 12 needed with php5.5 since it already has it included?

    On a test vps I did a fresh install with php 5.5 and did option 12. In php.ini I see options to enable it. I set them both to 1.
    Code:
    [opcache]
    ; Determines if Zend OPCache is enabled
    ;opcache.enable=1
    
    ; Determines if Zend OPCache is enabled for the CLI version of PHP
    ;opcache.enable_cli=1
    Is this all that is needed?
     
    Last edited: Jul 25, 2014
  2. Peter Downey

    Peter Downey Member

    62
    23
    8
    May 28, 2014
    Ratings:
    +25
    Local Time:
    3:14 PM
    I believe I answered most of my questions with a bit more research. I restarted the vps and did:
    Code:
    php -v
    which outputs
    Code:
    PHP 5.5.14 (cli) (built: Jul 20 2014 16:28:35)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
        with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    
    So it appears to be working as intended. I'm assuming option 12 adds the settings to php.ini and turns on the extension somewhere?
     
  3. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    From https://community.centminmod.com/threads/php-5-5-14-released-php-fpm.606/#post-3380 usually when you upgrade to PHP 5.5 via centmin.sh menu option 5, you get a prompt as to whether you want to enable Zend OPcache

    Code:
    Do you want to run YUM install checks ?  [y/n]
    
    This will increase your upgrade duration time wise.
    Check the change log centminmod.com/changelog.html
    to see if any Nginx or PHP related new additions
    which require checking YUM prequisites are met.
    If no new additions made, you can skip the
    YUM install check to speed up upgrade time.
    
    [y/n]:
    PHP Upgrade - Would you like to continue? [y/n] y
    
    Install which version of PHP? (version i.e. 5.4.29): 5.5.14
    Do you want to update to latest php-fpm.conf ? It will overwrite your existing php-fpm.conf [y/n]: n
    
    -----------------------------------------------------------------------------------------
    Detected PHP 5.5 branch.
    You can compile Zend OPcache (Zend Optimizer Plus+) support
    as an alternative to using APC Cache or Xcache cache.
    But Zend OPcache only provides PHP opcode cache and
    DOESN'T do data caching, so if you web apps such as Wordpress,
    Drupal or vBulletin require data caching to APC or Xcache,
    it won't work with Zend OPcache.
    
    -----------------------------------------------------------------------------------------
    Do you want to use Zend OPcache [y/n] ? y
    centmin.sh menu option 12 is more for when you haven't already installed Zend OPcache (if you didn't select yes in above prompt) submenu option 1 or when you need to reinstall Zend OPcache submenu option 2

    Code:
    --------------------------------------------------------
    Centmin Mod 1.2.3-eva2000.08 - http://centminmod.com
    --------------------------------------------------------
                       Centmin Mod Menu                  
    --------------------------------------------------------
    1).  Centmin Install
    2).  Add Nginx vhost domain
    3).  NSD setup domain name DNS
    4).  Nginx Upgrade / Downgrade
    5).  PHP Upgrade / Downgrade
    6).  XCache Re-install
    7).  APC Cache Re-install
    8).  XCache Install
    9).  APC Cache Install
    10). Memcached Server Re-install
    11). MariaDB 5.2, 5.5, 10 Upgrade Sub-Menu
    12). Zend OpCache Install/Re-install
    13). Install ioping.sh vbtechsupport.com/1239/
    14). SELinux disable
    15). Install/Re-install ImageMagick PHP Extension
    16). Change SSHD Port Number
    17). Multi-thread compression: pigz,pbzip2,lbzip2,p7zip etc
    18). Suhosin PHP Extension install
    19). Install FFMPEG and FFMPEG PHP Extension
    20). NSD Re-install
    21). Update - Nginx + PHP-FPM + Siege
    22). Exit
    --------------------------------------------------------
    Enter option [ 1 - 22 ] 12
    --------------------------------------------------------
    
    --------------------------------------------------------
            Zend OpCache Sub-Menu             
    --------------------------------------------------------
    1). Install Zend OpCache for PHP <5.5 or <5.6
    2). Reinstall Zend OpCache for PHP <5.5 or <5.6
    3). Back to Main menu
    --------------------------------------------------------
    Enter option [ 1 - 3 ] 
     
  4. Peter Downey

    Peter Downey Member

    62
    23
    8
    May 28, 2014
    Ratings:
    +25
    Local Time:
    3:14 PM
    Perfect, that makes a lot of sense. I didn't see that prompt because I edited centmin.sh on the fresh install and told it to just install php 5.5 from the start.

    Thanks for the explanation.
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    oh in .07 stable if you want to install PHP 5.5 and ZendOPcache out of the box first install, edit centmin.sh and set PHP_VERSION=5.5.15 and ZOCACHEDFT='y'. Then PHP 5.5.15 and ZendOPcache get installed on initial Centmin Mod install :)
     
    • Like Like x 1
  6. Peter Downey

    Peter Downey Member

    62
    23
    8
    May 28, 2014
    Ratings:
    +25
    Local Time:
    3:14 PM
    Even better. I missed that ZOCACHEDFT='y' when I did it. I'm hoping to have some time to play with .08 next week.