PHP OpCache Kurulumu – Installation Zend OpCache on CentOS

Merhabalar,

PHP Zend OPcache kurulumunu yum parametresi ile sadece birkaç adımda tamamlayacağız.

PHP Zend OPcache installation is very easy witf yum param.

to do-list

PHP OpCache Kurulumu

  • # yum update
    
  • Gerekli paketler / requirements
    # yum install gcc httpd-devel php-pear pcre-devel
    
  • PHP Opcache kurulumu / install opcache
    # yum install php-pecl-zendopcache
    
  • # service httpd restart

  • Kurulum tamamlandı, opcache kurulum testi için # php -v yaptığınızda ..with Zend OPcache.. göreceksiniz.
    The end! if you want to test the installation, you try # php -v and then you will see ...with Zend OPcache.. so, it is okay!
    ya da php info ile bakabilirsiniz

 

  • İhtiyaçlarınıza göre /etc/php.d/opcache.ini dosyası içerisindeki performans parametrelerini güncelleyebilirsiniz.
    if you want to changes the opcache performance parameter, you can change /etc/php.d/opcache.ini 
  • Örneğin;
    For example;

    zend_extension = opcache.so
    
    opcache.enable = 1
    
    ; Determines if Zend OPCache is enabled for the CLI version of PHP
    ;opcache.enable_cli=0
    
    ; The OPcache shared memory storage size.
    opcache.memory_consumption = 138
    
    ; The amount of memory for interned strings in Mbytes.
    opcache.interned_strings_buffer = 10
    
    ; The maximum number of keys (scripts) in the OPcache hash table.
    ; Only numbers between 200 and 100000 are allowed.
    opcache.max_accelerated_files = 300 
    
    ; If enabled, a fast shutdown sequence is used for the accelerated code
    opcache.fast_shutdown = 1
    
    ;following can be commented for production server
    opcache.revalidate_freq = 0
    opcache.consistency_checks = 1
    
    opcache.validate_timestamps = 0
    
    opcache.save_comments = 1
    
    opcache.force_restart_timeout = 180

 

Böylelikle PHP OPcache kurulumu tamamlanmış oldu ve gerekli olması durumunda opcache.ini dosyası üzerinden istediğiniz gibi değişiklik yapabilirsiniz.

 

Opcache ‘in istatistiklerini takip etmek isterseniz buradan / git üzerinden dosyaları indirip, OpCache i kullandığınız siteye yükleyip, dosya yolu üzerinden çalıştırabilirsiniz.

If you want to see OpCache stats and status, you should the download opcache zip file from here and then upload your using opcache site. Finally, run the opcache url.

 


Bir önceki yazımız olan Zaman Neden Çabuk Geçiyor ? başlıklı makalemizde zaman ve Zaman Neden Çabuk Geçiyor hakkında bilgiler verilmektedir.

1 Yorum

  1. Merhaba Şahin Bey
    Öncelikle bu yarlı ve öğretici paylaşımlarınız için teşekkür ederiz.
    Kurulum yaptıktan sonra bende bir sorun oluştu. Daha doğrusu sistemi etkilemeyen ve PHP Zend OPcache çalışmasını onaylamayan bir döngü oluştu.
    Kurulum esnasında herhangi bir hata alamadım. Servis restart komutunda
    ]# service httpd restart
    Stopping httpd: [FAILED]
    Starting httpd: httpd: apr_sockaddr_info_get() failed for s1.nakisipi.com
    httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
    (98)Address already in use: make_sock: could not bind to address [::]:80
    (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs

    bu hatayı alıyorum. Kontrol için php -v komutunu verdiğim zaman

    php -v
    PHP 5.3.3 (cli) (built: Feb 9 2016 10:21:34)
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

    bu sonuçla karşılaşıyorum. Sanki kurulum hiçoluşmamış gibi.
    Sizce sorun nerden kaynaklı olabilir ?
    İyi çalışmalar dilerim.

    Reply
    • Aşkın Bey Merhaba,
      Yorum otomatik onaylandığı için henüz fark ettim:

      Öncelikle belirtmekte fayda var; bu sorun OpCache kurulumundan kaynaklanmıyor. Daha önce yaptığınız bir değişiklikle ilgili. Genel bir değişiklik yaptığınız zaman servisleri yeniden başlatmayı/test etmeyi ihmal etmeyiniz.

      Bu problemi çözdüğünüzü varsayarak, müsait olduğunuz bir vakitte PHP versiyonunuzu da güncellemenizi tavsiye ederim. Yakın gelecekte zaten PS de bu versiyonu desteklemeyecek.

      Başarılar,
      İyi çalışmalar.

      Reply

Askin Incesulu için bir cevap yazınCevabı iptal et