August 5, 2014 - Warren Held

Installing Zend OpCache for PHP on CentOS 7 or REHL

I found a nice RPM repository that has a bunch of pre-compiled php extensions from various versions of Fedora, CentOS, and REHL.  Here is the short and sweet on how to easily get the Zend OpCache running for PHP on CentOS 7.

Download and install the RPM to add the configuration data for the repository to yum:

[shell]
wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
[/shell]

Install the Zend OpCache plugin:

[shell]
sudo yum install php-pecl-zendopcache.x86_64
[/shell]

 

Restart Apache:

[shell]
sudo systemctl restart httpd.service
[/shell]

 

Change into your html directory and download Rasmus Lerdorf’s OpCache status page to check and see if the OpCache is running:

[shell]
cd /var/www/html
wget https://raw.githubusercontent.com/rlerdorf/opcache-status/master/opcache.php
[/shell]

Now browse to opcache.php in your web browser.

Uncategorized