Welcome to Centmin Mod Community
Become a Member

[Solved] PHP Warning: Zend OPcache can't be temporary enabled (it may be only disabled till the end of reque

Discussion in 'Bug Reports' started by Matt, Apr 8, 2019.

  1. Matt

    Matt Moderator Staff Member

    811
    357
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +545
    Local Time:
    6:16 PM
    1.5.15
    MariaDB 10.2
    Brand new server. CentOS7.6. Getting a ton of these warnings in the www-php.error.log

    Code:
    [07-Apr-2019 18:14:23 UTC] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
    
    [07-Apr-2019 18:14:23 UTC] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
    
    [07-Apr-2019 18:14:23 UTC] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
    
    [07-Apr-2019 18:14:23 UTC] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
    
    [07-Apr-2019 18:14:23 UTC] PHP Warning:  Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) in Unknown on line 0
    zendopcache is enabled and working, and I can only find it being loaded once (per the zendopcache.ini file).

    Code:
    PHP 7.2.17 (cli) (built: Apr  5 2019 13:24:06) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.17, Copyright (c) 1999-2018, by Zend Technologies
     
  2. Matt

    Matt Moderator Staff Member

    811
    357
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +545
    Local Time:
    6:16 PM
    1.5.15
    MariaDB 10.2
    Never mind! Found a hidden user.ini file in the public folder which is causing a conflict with opcache.
     
  3. eva2000

    eva2000 Administrator Staff Member

    39,155
    8,647
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,296
    Local Time:
    3:16 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    what was contained in user.ini to cause that ?
     
  4. Matt

    Matt Moderator Staff Member

    811
    357
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +545
    Local Time:
    6:16 PM
    1.5.15
    MariaDB 10.2
    Code:
    # cat .user.ini
    opcache.enable=1
    opcache.max_accelerated_files=7963
    opcache.memory_consumption=192
    opcache.interned_strings_buffer=16
    opcache.fast_shutdown=1
    opcache.validate_timestamps=0
    opcache.interned_strings_buffer=16
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    39,155
    8,647
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,296
    Local Time:
    3:16 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    ok probably was this setting as Zend Opcache seems to spit the dummy when you try different and more than one way to enable Zend Opcache i.e. via user.ini and /etc/centminmod/php.d/zendopcache.ini :)
     
..