Improve Php Performance in Centos By using Opcache

Lim Sing
Apr 27, 2021

It known as Zend Optimizer+, Opcache, which can help to improve server and applications performance. It work by pre-compiling script byte-code in shared memory, so it help removing the need for php to load and parse scripts on each client request.

  1. yum install php-opcache
  2. run php -v to ensure php has this extension, will show:
  1. vi /etc/php.d/10-opcache.ini
  2. enable all of these by uncomment them:
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

4. service httpd restart or systemctl restart nginx

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Lim Sing
Lim Sing

No responses yet

Write a response