Discover Centmin Mod today
Register Now

PHP-FPM Cannot load Zend OPcache - it was already loaded

Discussion in 'Bug Reports' started by runos, Feb 27, 2020.

  1. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    5:52 PM
    1.17.6
    10
    Hi! I'm getting these warning message "Cannot load Zend OPcache - it was already loaded" whenever I run php -v.


    Code:
    Cannot load Zend OPcache - it was already loaded
    PHP 7.3.15 (cli) (built: Feb 27 2020 18:23:58) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.15, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.15, Copyright (c) 1999-2018, by Zend Technologies
    
    Is this normal?
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.17.8
    • PHP Version Installed: 7.3.15
    • MariaDB MySQL Version Installed: 10.2.xx
    • When was last time updated Centmin Mod code base ? : cmupdate
    • Persistent Config:
      Code (Text):
      # Disable or Enable PHP File Info extension
      PHPFINFO='y'
      # Maxmind geolite2 api key license
      MM_LICENSE_KEY='jqmQD7q6vxAj1Wq3'
      # dynamically tune nginx ssl_session_cache in /usr/local/nginx/conf/ssl_include.conf based on system detected memory
      # https://community.centminmod.com/posts/76615/
      NGINX_SSLCACHE_ALLOWOVERRIDE='y'
      # SET_DEFAULT_MYSQLCHARSET='utf8mb4' to override MariaDB MySQL
      # default characterset and collation from default utf8 to utf8mb4
      # https://community.centminmod.com/threads/17949/
      SET_DEFAULT_MYSQLCHARSET='utf8mb4'
      # enable nginx backlog override https://community.centminmod.com/threads/17620/
      AUTOHARDTUNE_NGINXBACKLOG='y'
      # enable zstd compressed logrotation for nginx & php-fpm https://community.centminmod.com/threads/16374/
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      # boost PHP 7 performance by enabling Profile Guided Optimisation flag
      PHP_PGO='y'
      PHP_PGO_ALWAYS='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      AUDITD_ENABLE='y'
      MARCH_TARGETNATIVE='n'
      LETSENCRYPT_DETECT='y'
      DUALCERTS=’y’
      LIBRESSL_SWITCH='n'
      NGINX_PATCH='y'
      NGINX_HPACK='y'
      NGINX_DYNAMICTLS='y'
      NGINX_LIBBROTLI='y'
      NGXDYNAMIC_BROTLI='y'
      AUTOTUNE_CLIENTMAXBODY='y'      # auto tune client_max_body_size option in nginx.conf
      NGINX_IOURING_PATCH='y'
      NGINX_STREAM='n'               # http://nginx.org/en/docs/stream/ngx_stream_core_module.html
      NGINX_STREAMGEOIP='n'          # nginx 1.11.3+ option http://hg.nginx.org/nginx/rev/558db057adaa
      NGINX_STREAMREALIP='n'         # nginx 1.11.4+ option http://hg.nginx.org/nginx/rev/9cac11efb205
      NGINX_STREAMSSLPREREAD='n'     # nginx 1.11.5+ option https://nginx.org/en/docs/stream/ngx_stream_ssl_preread_module.html
      NGINX_RTMP='n'                 # Nginx RTMP Module support https://github.com/arut/nginx-rtmp-module
      NGINX_FLV='n'                  # http://nginx.org/en/docs/http/ngx_http_flv_module.html
      NGINX_MP4='n'                  # Nginx MP4 Module http://nginx.org/en/docs/http/ngx_http_mp4_module.html
      NGINX_AUTHREQ='n'              # http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
      NGINX_SECURELINK='n'           # http://nginx.org/en/docs/http/ngx_http_secure_link_module.html
      NGINX_FANCYINDEX='n'           # http://wiki.nginx.org/NgxFancyIndex
      NGINX_VHOSTSTATS='n'           # https://github.com/vozlt/nginx-module-vts
      NGINX_PAGESPEED='n'            # Install ngx_pagespeed
      NGINX_PASSENGER='n'            # Install Phusion Passenger requires installing addons/passenger.sh before hand
      NGINX_WEBDAV='n'               # Nginx WebDAV and nginx-dav-ext-module
      NGINX_UPSTREAMCHECK='n'        # nginx upstream check https://github.com/yaoweibin/nginx_upstream_check_module
      LUAJIT_GITINSTALL='n'          # opt to install luajit 2.1 from dev branch http://repo.or.cz/w/luajit-2.0.git/shortlog/refs/heads/v2.1
      ORESTY_LUANGINX='n'            # enable or disable or ORESTY_LUA* nginx modules below
      NGINX_MODSECURITY='n'
      NGINX_STUBSTATUS=y             # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html required for nginx statistics
      NGINX_SUB='n'                  # http://nginx.org/en/docs/http/ngx_http_sub_module.html
      NGINX_ADDITION='n'             # http://nginx.org/en/docs/http/ngx_http_addition_module.html
      NGINX_IMAGEFILTER='n'          # http://nginx.org/en/docs/http/ngx_http_image_filter_module.html
      NGINX_CACHEPURGE='y'           # https://github.com/FRiCKLE/ngx_cache_purge/
      NGINX_ACCESSKEY='n'            #
      NGINX_HTTPCONCAT='n'           # https://github.com/alibaba/nginx-http-concat
      NGINX_THREADS='y'              # https://www.nginx.com/blog/thread-pools-boost-performance-9x/
      ORESTY_HEADERSMORE='y'         # openresty headers more https://github.com/openresty/headers-more-nginx-module
      
      
      
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:52 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what's output for
    Code (Text):
    php --ini

    Code (Text):
    php -m

    Code (Text):
    ls -lah $(php-config --extension-dir)
     
  3. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    5:52 PM
    1.17.6
    10
    php --ini
    Code:
    Cannot load Zend OPcache - it was already loaded
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/b_customphp.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/mailparse.ini,
    /etc/centminmod/php.d/mcrypt.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/redis.ini,
    /etc/centminmod/php.d/timezonedb.ini,
    /etc/centminmod/php.d/zendopcache.ini,
    /etc/centminmod/php.d/zendopcache_custom.ini
    
    php -m
    Code:
    Cannot load Zend OPcache - it was already loaded
    [PHP Modules]
    bcmath
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    exif
    fileinfo
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    ldap
    libxml
    mailparse
    mbstring
    mcrypt
    memcache
    memcached
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    sodium
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    timezonedb
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    [Zend Modules]
    Zend OPcache
    
    ls -lah $(php-config --extension-dir)
    Code:
    total 6.0M
    drwxr-xr-x. 2 root root  190 Feb 27 18:26 .
    drwxr-xr-x. 3 root root   39 Jan 15 23:10 ..
    -rwxr-xr-x. 1 root root  30K Feb 27 18:25 geoip.so
    -rwxr-xr-x. 1 root root 1.9M Feb 27 18:26 igbinary.so
    -rwxr-xr-x. 1 root root 545K Feb 27 18:25 imagick.so
    -rwxr-xr-x. 1 root root  67K Jan 15 23:16 mailparse.so
    -rwxr-xr-x. 1 root root  53K Feb 27 18:26 mcrypt.so
    -rwxr-xr-x. 1 root root 137K Jan 15 23:14 memcached.so
    -rwxr-xr-x. 1 root root 123K Jan 15 23:14 memcache.so
    -rwxr-xr-x. 1 root root 1.9M Feb 27 18:24 opcache.so
    -rwxr-xr-x. 1 root root 672K Jan 25 13:52 redis.so
    -rwxr-xr-x. 1 root root 725K Feb 27 18:26 timezonedb.so
    
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,529
    12,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,781
    Local Time:
    7:52 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    PHP 5.6+ has native Zend Opcache support so you do not specially need to run centmin.sh menu option 12 anymore. What you've done is probably run centmin.sh menu option 12 and inadvertently loaded the standalone Zend Opcache extension module as a duplicate

    or you could have 2 instances of zend_extension=opcache.so in both .ini settings files as you only need for it to loaded once via zendopcache.ini
    Code (Text):
    /etc/centminmod/php.d/zendopcache.ini
    /etc/centminmod/php.d/zendopcache_custom.ini

    remove the duplicate zend_extension load line and restart php-fpm service
     
  5. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    5:52 PM
    1.17.6
    10
    Got it fixed by removing the content of
    zendopcache_custom.ini

    Thank you!