OPCache는 성능향상을 위해서 사용하는 확장 기능이다.
더보기
PHP는 컴파일 > 실행 > 결과의 프로세스를 거치게 되는데,
OPcache는 컴파일된 코드를 바이너리로 메모리에 캐싱해 결과값을 빠르게 얻을 수 있는 역할을 한다.
확장 유틸리티 설치
# yum install yum-utils
Opcache 확장 프로그램 설치
# yum install php-opcache
PHP 버전 확인
# php -v
실행 결과
opcache.ini 파일 편집
# vi /etc/php.d/10-opcache.ini
다음을 주석처리 해제한다.
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
웹서버 재시작
# systemctl restart httpd
PHP 경로 확인
# whereis php
Zend 확인
# /usr/bin/php -m | grep Zend
끗
'Development > PHP' 카테고리의 다른 글
[PHP] 쉘 함수 exec()와 파라미터 전달 (0) | 2022.11.17 |
---|---|
PHP ext-zip 확장 설치 (0) | 2022.02.24 |
[CentOS 7] PHP 7.4 설치하기 (0) | 2022.02.23 |
json decode 안될 때 (0) | 2022.01.12 |
정규표현식 - 특정 HTML 태그 제거하기 (0) | 2022.01.12 |