How to install php-opcache in centos 6 or centos 7

Install PHP-Opcache centos 7

How to install PHP-opcache In Centos 6 / 7, PHP 5.5 or above

What is php-opcache?

Opcache improves PHP performance by storing precompiled scripts. Opcache

coming after PHP 5.5 or later opcache stored precompiled script bytecode in memory.

opcache used to improve php performance. So if u want to improve php performance

you should use it for better PHP performance.

After install and configuration PHP

install php-opcache on Centos 7 with below method:-

To create remi file type below command

# wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# rpm -Uvh remi-release-7*.rpm

after creating remi file need to install opcache package

# yum -y install php-opcache

to check properly install open the configration file

# vim /etc/php.d/opcache.ini

then restart apache service

# service httpd restart
or
# systemctl restart httpd

 

To install PHP-opcache in centos 6

Step 1:- To create remi file type below command for centos 6 we used remi-release-6

# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# rpm -Uvh remi-release-6*.rpm

Step 2:- install opcache with this command.

# yum -y install php-opcache

note:  -y use for package dependency

Step 3:- Verify Package install or not with this command.

# vim /etc/php.d/opcache.ini

Then restart apache service with below command.

# service httpd restart
or
# systemctl restart httpd

That's it! Now, opcache working well.

comment below if any problem in installation

Blog type: 

Add new comment

Authored By

Sandeep Gurjar

Hy all, This is Sandeep Gurjar am the founder of hostingride.in. I am a Redhat Certified Engineer (RHCE) / AWS Solutions Architect-Associate and working as an system administrator since 2016.

Follow us on

Facebook​  Twitter  LinkedIn  Google+