OPcache는 미리 컴파일된 스크립트 바이트코드를 공유 메모리에 저장하여 PHP 성능을 향상시켜 PHP가 각 요청에 대해 스크립트를 로드하고 구문 분석할 필요가 없습니다.
버전 : PHP 5.5이상 지원
설정 정리
; Zend OPCache가 활성화되었는지 확인합니다.
;opcache.enable=1
; PHP의 CLI 버전에 Zend OPCache가 활성화되어 있는지 확인합니다.
;opcache.enable_cli=0
; OPCache 공유 메모리 스토리지 크기입니다.
;opcache.memory_consumption=128
; interned 문자열을 위해 사용할 메모리량
;opcache.interned_strings_buffer=8
; OPcache 해시 테이블의 최대 키(스크립트) 수입니다.
; 200에서 1000000 사이의 숫자만 허용됩니다.
;opcache.max_accelerated_files=10000
; 다시 시작이 예약될 때까지 낭비된 메모리의 최대 백분율입니다.
;opcache.max_wasted_percentage=5
; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1
; 비활성화된 경우 OPcache를 수동으로 재설정하거나 파일 시스템 변경 사항을 적용하려면 웹 서버를 다시 시작해야 합니다.
;opcache.validate_timestamps=1
; php소스 변경 확인 간격
;opcache.revalidate_freq=2
; include_path 최적화에서 파일 검색을 활성화 또는 비활성화합니다.
;opcache.revalidate_path=0
; 파일 존재 재정의(file_exists 등) 성능 기능을 허용합니다.
;opcache.enable_file_override=0
; 각 비트가 적절한 OPcache 패스를 활성화하거나 비활성화하는 비트 마스크
;opcache.optimization_level=0x7FFFBFFF
; OPcache 블랙리스트 파일의 위치(와일드카드 허용).
각 OPcache 블랙리스트 파일은 파일 이름을 포함하는 텍스트 파일입니다.
(즉, /var/www/x는 /var/www에 있는 모든 파일과 디렉토리를 블랙리스트에 추가합니다.
'x'로 시작). 로 시작하는 줄은 무시됩니다(주석).
;opcache.blacklist_filename=
; 대용량 파일을 캐시에서 제외할 수 있습니다. 기본적으로 모든 파일이 캐시됩니다.
;opcache.max_file_size=0
; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180
; OPCache error_log 파일 이름. 빈 문자열은 "stderr"을 가정합니다.
;opcache.error_log=
; 스크립트 실행 중 예기치 않은 쓰기로부터 공유 메모리를 보호합니다.
; 내부 디버깅에만 유용합니다.
;opcache.protect_memory=0
; Allows calling OPcache API functions only from PHP scripts which path is
; started from specified string. The default "" means no restriction
;opcache.restrict_api=
; Facilitates multiple OPcache instances per user (for Windows only). All PHP
; processes with the same cache ID and user share an OPcache instance.
;opcache.cache_id=
; 공유 메모리에서 opcode 캐싱을 활성화하거나 비활성화합니다.
;opcache.file_cache_only=0
; 스크립트가 파일 캐시에서 로드될 때 체크섬 유효성 검사를 활성화하거나 비활성화합니다.
;opcache.file_cache_consistency_checks=1
; HUGE PAGES로 PHP 코드(텍스트 세그먼트) 복사를 활성화 또는 비활성화합니다.
; 이렇게 하면 성능이 향상되지만 적절한 OS 구성이 필요합니다.
;opcache.huge_code_pages=1
; 캐시된 파일 권한을 확인합니다.
;opcache.validate_permission=0
; chroot 환경에서 이름 충돌을 방지합니다.
;opcache.validate_root=0
; 지정된 경우 여러 최적화 단계를 디버깅하기 위한 opcode 덤프를 생성합니다.
;opcache.opt_debug_level=0
; 서버 시작 시 컴파일 및 실행될 PHP 스크립트를 지정합니다.
; http://php.net/opcache.preload
;opcache.preload=
; 보안상의 이유로 루트로 코드를 미리 로드하는 것은 허용되지 않습니다. 이 지시문은 다른 사용자로 미리 로드할 수 있도록 합니다.
; http://php.net/opcache.preload_user
;opcache.preload_user=
; 이 시간(초) 미만인 파일 캐싱을 방지합니다.
;opcache.file_update_protection=2
; 공유 잠금 파일을 저장하는 데 사용되는 절대 경로(*nix 전용).
;opcache.lockfile_path=/tmp