Disable Opcache for PHP

 

PHP 7 accelerates many dynamic websites by over 100% compared to PHP 5.6 through OpCode caching and an optimized Zend engine.

For your visitors, this means a better user experience due to faster page set-up, for your website an improved ranking on Google due to higher page speed.

 

Speed improvements in PHP 7

PHP 7 achieves the enormous increase in speed primarily through improvements to the Zend Engine, extended OpCode caching, an improved data structure and thus reduced memory requirements and more efficient memory management.

 

How OpCode Caching Works

Normally PHP scripts are compiled at runtime. Part of the computing time is required to convert the code. When using OPcache, this calculation is performed only once and the precompiled, script is stored in a cache. The script can subsequentially be loaded from this cache at lightning speed if required. In most cases this leads to considerable speed improvements.

Especially larger websites can handle much more requests simultaneously with OPcache activated - an important advantage for corporate websites and eCommerce applications.

 

How to Disable OPcache

Opcode Caching is enabled by default for all websites. In case you want to disable it you can do so by doing the following:

Enter in your .htaccess file:

php_flag opcache.enable Off

or you can place the following in your php script:

ini_set('opcache.enable', '0');
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to make a backup of your website

This section covers choosing what to save, creating backups, storing backups, and restoring your...

.htaccess tutorial

  Part 1 - Introduction In this guide you will find out about the .htaccess file and the power...

HTML - The Basics

  This tutorial includes the following sections: Part 1 - Your First Page Part 2 - Adding...

Uploading files to your website

You can begin uploading files to your hosting account now by using one of two methods: an FTP...

What is PHP?

Short for PHP: Hypertext Preprocessor, an open source, server-side, HTML embedded scripting...