PHP 7 설치에서 “Zend OPcache를로드 할 수 없습니다-이미로드되었습니다”오류가 발생합니다 | 5.7 MB

나는 salt서버를 프로비저닝 하는 데 사용 하고 있으며 방금 PHP 7로 업그레이드하려고했지만 모든 것이 올바르게 설치되었지만 PHP를 실행 php -v하거나 실행할 때마다 출력 헤드에서이를 던집니다 Cannot load Zend OPcache - it was already loaded. 이 메시지가 표시되면 제거하면Failed loading /usr/lib64/php/modules/opcache.so: /usr/lib64/php/modules/opcache.so: cannot open shared object file: No such file or directory

다음은 설치 php-v되거나 php-opcache설치 되지 않은 전체 출력입니다 .

Cannot load Zend OPcache - it was already loaded
PHP 7.0.1 (cli) (built: Dec 16 2015 15:31:55) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans

밖으로

Failed loading /usr/lib64/php/modules/opcache.so:  /usr/lib64/php/modules/opcache.so: cannot open shared object file: No such file or directory
PHP 7.0.1 (cli) (built: Dec 16 2015 15:31:55) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans

이것과 함께 설치합니다 (소금 상태 파일에서)

remi-php70-repo:
  pkgrepo.managed:
    - humanname: Remi PHP 7 Repository
    - baseurl: http://rpms.famillecollet.com/enterprise/$releasever/php70/$basearch/
    - gpgcheck: 0
    - require_in:
      - pkg: php-fpm

php-fpm:
  pkg.latest:
    - pkgs:
      - php-fpm

php-opcache:
  pkg.latest:
    - pkgs:
      - php-opcache

그리고 a yum install php-opcache및 a를 기반으로 7.0 리포지토리에서 설치하는 것을 알고 있습니다 .php -v

터미널 출력

[root@mage2appblock vagrant]# yum install php-opcache
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                    |  14 kB     00:00
 * base: mirror.spro.net
 * epel: mirrors.cat.pdx.edu
 * extras: mirror.keystealth.org
 * updates: mirror-centos.hostingswift.com
base                                                                                             | 3.7 kB     00:00
centos-plus-repo                                                                                 | 3.4 kB     00:00
epel                                                                                             | 4.3 kB     00:00
epel/primary_db                               35% [============-                      ]  0.0 B/s | 2.1 MB     --:-- ETA epel/primary_db                                                                                  | 5.7 MB     00:00
extras                                                                                           | 2.9 kB     00:00
mysql56-community-repo                                                                           | 2.5 kB     00:00
remi-php70-repo                                                                                  | 2.9 kB     00:00
remi-rep                                                                                         | 2.9 kB     00:00
remi-rep/primary_db                            7% [==                                 ]  0.0 B/s |  97 kB     --:-- ETA remi-rep/primary_db                           37% [=============                      ] 655 kB/s | 510 kB     00:01 ETA remi-rep/primary_db                                                                              | 1.3 MB     00:00
repo-saltstack-el6                                                                               | 2.9 kB     00:00
updates                                                                                          | 3.4 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package php-opcache.x86_64 0:7.0.1-1.el6.remi will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                    Arch                  Version                          Repository                      Size
========================================================================================================================
Installing:
 php-opcache                x86_64                7.0.1-1.el6.remi                 remi-php70-repo                135 k

Transaction Summary
========================================================================================================================
Install       1 Package(s)

Total download size: 135 k
Installed size: 378 k
Is this ok [y/N]: y
Downloading Packages:
php-opcache-7.0.1-1.el6.remi.x86_64.rpm       18% [======-                            ]  0.0 B/s |  25 kB     --:-- ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm       31% [===========                        ]  27 kB/s |  43 kB     00:03 ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm       38% [=============-                     ]  28 kB/s |  52 kB     00:02 ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm       48% [================-                  ]  29 kB/s |  65 kB     00:02 ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm       55% [===================-               ]  29 kB/s |  75 kB     00:02 ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm       69% [========================           ]  31 kB/s |  94 kB     00:01 ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm       90% [===============================-   ]  35 kB/s | 122 kB     00:00 ETA php-opcache-7.0.1-1.el6.remi.x86_64.rpm                                                          | 135 kB     00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-opcache-7.0.1-1.el6.remi.x86_64                                                                  1/1
  Verifying  : php-opcache-7.0.1-1.el6.remi.x86_64                                                                  1/1

Installed:
  php-opcache.x86_64 0:7.0.1-1.el6.remi

Complete!
[root@mage2appblock vagrant]# php -v
Cannot load Zend OPcache - it was already loaded
PHP 7.0.1 (cli) (built: Dec 16 2015 15:31:55) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    with Xdebug v2.4.0RC3, Copyright (c) 2002-2015, by Derick Rethans

나는 이것과 관련된 것을 전혀 찾을 수 없었습니다. 어떤 아이디어라도 좋을 것입니다.

도움이 될만한 참고 사항 :

  1. vagrantCentOS 6.5를로드 하는 서버입니다
  2. 프로비저닝은 다음을 통해 제공됩니다. salt
  3. salt실행될 때 설치가 깨끗 합니다.

업데이트

그래서 Zen Opcache를 설치하려고 시도했지만 PHP 7과 호환된다고 생각했습니다. 무엇이로드되고 있는지 또는 내가 제공하는 opcache.ini 파일에 문제가 있는지 확인하려고합니다. 해당 영역에서 php5가 php 7로 이동하는 새로운 설정이있을 수 있습니다.



답변

내가 opcache.iniPHP 5에서 기본적으로 사용했던 파일을 로드하고 있지만 PHP 7에서는 10-opcache.ini기본적 으로로드되어 opcache.ini 파일이 프로비저닝 될 때 두 개의 .ini파일이 있고 플러그인을 두 번로드하려고 시도한 것으로 나타났습니다 .

간과하기 쉽고 오류가 있다고 생각하기 때문에이 질문을 삭제하지 않을 것입니다. 실제로 오류 단계를 Google에 표시 할 수 없기 때문에 도움이 될 수 있으므로 ini 파일이 두 배로 증가했습니다. 또는 확장을 두 번 선언합니다.


답변