opcache开启和关闭
生活随笔
收集整理的這篇文章主要介紹了
opcache开启和关闭
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
來源:https://www.cnblogs.com/chenguoli/p/7607208.html
查看opcache狀態
php -i |grep opcache// 結果如下,可以看出opcache.enable => On,處于開啟狀態 Configure Command => './configure' '--prefix=/usr/local/php-fpm' '--with-config-file-path=/usr/local/php-fpm/etc' '--with-config-file-scan-dir=/usr/local/php-fpm/etc/conf.d' '--enable-opcache' '--enable-fpm' '--enable-calendar' '--enable-ftp' '--with-gmp' '--with-openssl' '--enable-pcntl' '--enable-shmop' '--enable-sysvmsg' '--enable-sysvsem' '--enable-wddx' '--with-xsl' '--enable-bcmath' '--with-libxml-dir' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--with-zlib' '--with-mcrypt' '--enable-exif' '--with-curl' '--enable-mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-mysql=mysqlnd' '--with-gd' '--with-vpx-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--with-tidy' '--with-xpm-dir' '--with-freetype-dir' '--enable-gd-native-ttf' '--with-gettext' '--with-bz2' /usr/local/php-fpm/etc/conf.d/opcache.ini, opcache.blacklist_filename => no value => no value opcache.consistency_checks => 0 => 0 opcache.dups_fix => Off => Off opcache.enable => On => On opcache.enable_cli => Off => Off opcache.enable_file_override => Off => Off關閉opcache
1. 打開opcache配置文件,如上: vi /usr/local/php-fpm/etc/conf.d/opcache.ini2. 注釋掉 ;zend_extension=opcache.so ;opcache.enable=1 ;opcache.enable_cli=0 //disable php_cli ;opcache.memory_consumption=256 //共享內存大小, 這個根據你們的需求可調 ;opcache.interned_strings_buffer=16 //interned string的內存大小, 也可調 ;opcache.max_accelerated_files=40000 //最大緩存的文件數目 ;opcache.revalidate_freq=60 //60s檢查一次文件更新 ;opcache.fast_shutdown=1 ;opcache.save_comments=0 //不保存文件/函數的注釋3. 重啟PHP /etc/init.d/php-fpm reload總結
以上是生活随笔為你收集整理的opcache开启和关闭的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PHP7开启opcache打造强悍性能
- 下一篇: redis没有加密码导致服务器被当做矿机