• Announcements

    • Guest Blog Admin

      Welcome Bloggers   06/25/2017

      Guest Blog is a portal for guest bloggers, Guest.blog was created in the idea of making Guest Bloggers post their own contents without any hassle by simply Signing up but anyhow article will be published after verified by a moderator, All qualified articles will be approved and will visible to public after that so writing a worthy content is your way to success here.

Recommended Posts

APCu-Cache-Installation.thumb.jpg.6ba6b8d5ada6b615cbb2a29f65352317.jpg

EA4 did not support APCu in the prior versions but after upgrading your WHM to latest version you can install APCu without hassle, the problem with EasyApache4 is that you can have multiple PHP Versions installed on a single server which is great but when installing APCu you will have to install and enable APCu for every PHP versions separately.

What is APCu Cache?
APCu Cache is the userdata component of the old APC, without the bytecode caching, because OpCache is now the standard bytecode caching for PHP, but doesn’t provide userdata caching

First know to which PHP version you are going to install APCU, valid PHP versions are ea-php54 (PHP 5.4),ea-php55 (PHP 5.5), ea-php56 (PHP 5.6), ea-php70 (PHP 7.0) & ea-php71 (PHP 7.1). There may be any latest PHP versions may available in the future you can check them in EasyApache4 Configuration menu that looks similar to image below.

The following steps guide how to install APCU for PHP 7, if you want to install APCU for any other PHP versions replace ea-php70 in the command with suitable PHP version (example: for PHP5.6 replace ea-php70 with ea-php56)

/opt/cpanel/ea-php70/root/usr/bin/pecl install apcu

 

Installation will ask if you want to enable debugging just press Enter which is default for NO (Disable debugging).
APCU is now installed but it is not working yet because you have to add
extension=apcu.so to php.ini & restart apache
you can do that simply by using following commands, use them one by one.

echo ";APCU Enabled" >> /opt/cpanel/ea-php70/root/etc/php.ini
echo "extension=apcu.so" >> /opt/cpanel/ea-php70/root/etc/php.ini
service httpd restart

 

Im using the following APCU configuration, on a server i manage, you can change parameters as for your need, if you have a better configuration, explain me in comments i can update this article.

;APCU Enabled
extension=apcu.so
apc.enabled=1
apc.shm_size = 64M
apc.ttl=7200
apc.enable_cli=1
apc.gc_ttl=3600
apc.entries_hint=40960
apc.slam_defense=1
apc.serializer=igbinary

Download APCu Monitor (Attached below) and upload it to your Domain document root, you can check statistics by visiting http://www.yourwebsite.com/apcu.php (This php doesn’t require authentication, delete it or set admin password by editing the apcu.php).

For the Lazy Devs who don’t have time to read everything above 🙂

Install APCU for PHP 5.4 with EasyApache4 (EA4) on CentOS

printf "\n" | /opt/cpanel/ea-php54/root/usr/bin/pecl install apcu
echo ";APCU Enabled" >> /opt/cpanel/ea-php54/root/etc/php.ini
echo "extension=apcu.so" >> /opt/cpanel/ea-php54/root/etc/php.ini
service httpd restart

 

Install APCU for PHP 5.5 with EasyApache4 (EA4) on CentOS

printf "\n" | /opt/cpanel/ea-php55/root/usr/bin/pecl install apcu
echo ";APCU Enabled" >> /opt/cpanel/ea-php55/root/etc/php.ini
echo "extension=apcu.so" >> /opt/cpanel/ea-php55/root/etc/php.ini
service httpd restart

 

Install APCU for PHP 5.6 with EasyApache4 (EA4) on CentOS

printf "\n" | /opt/cpanel/ea-php56/root/usr/bin/pecl install apcu
echo ";APCU Enabled" >> /opt/cpanel/ea-php56/root/etc/php.ini
echo "extension=apcu.so" >> /opt/cpanel/ea-php56/root/etc/php.ini
service httpd restart

 

Install APCU for PHP 7 with EasyApache4 (EA4) on CentOS

printf "\n" | /opt/cpanel/ea-php70/root/usr/bin/pecl install apcu
echo ";APCU Enabled" >> /opt/cpanel/ea-php70/root/etc/php.ini
echo "extension=apcu.so" >> /opt/cpanel/ea-php70/root/etc/php.ini
service httpd restart

 

Install APCU for PHP 7.1 with EasyApache4 (EA4) on CentOS

printf "\n" | /opt/cpanel/ea-php71/root/usr/bin/pecl install apcu
echo ";APCU Enabled" >> /opt/cpanel/ea-php71/root/etc/php.ini
echo "extension=apcu.so" >> /opt/cpanel/ea-php71/root/etc/php.ini
service httpd restart

 

APCu_Monitor.zip

Share this post


Link to post
Share on other sites
clockwork    1

Hi,

Nice guide,but

/opt/cpanel/ea-php70/root/usr/bin/pecl install apcu

Did i need to change "root" to my domain username ?

 

 

Edited by clockwork
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this