تماس 9 تا 21 و تیکت 24 ساعته

آموزش نصب Zend OpCache در دایرکت ادمین

 فایل برنامه Zend OpCache فایل های php را بهینه و در کش ذخیره میکند.
این برنامه عملکرد php را با ذخیره کردن بایت کد اسکریپت ها و اشتراک گذاری ان در مموری ، افزایش می دهد

نحوه کارکرد opcache در عکس زیر قابل مشاهده است

 

Note: Check which version is the latest here. I’m installing 7.0.2.

Configure

Now that it’s installed, we need to set up its configuration. Ubuntu (and Debian?) has a convention to put all conf files in /etc/php5/conf.d, which are symlinked from /etc/php5/mods-available. Here’s how to set that up:

First, find the location of opcache.so:

Once you have the location, you can add that to the conf file for opcache:

In case your application (or the framework it is built on) only uses annotations at development time, you can achieve even better performance by adding opcache.save_comments=0 in your PHP configuration file as well.

Now that the INI file is created, symlink it to its proper place:

Lastly, I happen to be running php5-fpm with Nginx, so I need to restart the PHP service for the changes to take effect:

If you’re running PHP in Apache, just give that a restart:

Confirm Installed

To confirm it’s installed, run php -v, and you should get some information about Zend OpCache being installed:

Cleaning up

In production, you may not want the build dependencies hanging around. You can rid of the ones installed above by running:

Example Improvement!

Here’s what happened here after installing Zend OpCache on the fideloper.com server:

opcache improvement on fideloper.com

Resources

  1. PHP 5.5 OpCache
  2. Article on Installation (German)
  3. Documentation
درباره نویسنده

لطفا به این مطلب نظر دهید