Learn about Centmin Mod LEMP Stack today
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 Well-Known Member

    928
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    3:22 AM
    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 Well-Known Member

    928
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    3:22 AM
    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

    53,594
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what was contained in user.ini to cause that ?
     
  4. Matt

    Matt Well-Known Member

    928
    415
    63
    May 25, 2014
    Rotherham, UK
    Ratings:
    +671
    Local Time:
    3:22 AM
    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

    53,594
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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 :)