Page 1 of 1

[HowTo] Install PHP OPCache APC/APCu Memcached and Redis on VestaCP CentOS

Posted: Tue Sep 11, 2018 7:19 pm
by xorro
Lets get Started :
First install Remi repo :
CentOS 7

Code: Select all

wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm
CentOS 6

Code: Select all

wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm
To install Zend Opcache :

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

Code: Select all

yum install php-opcache
After installation you need to restart Apache/php-fpm :

if you’re using Apache (mod_php) :

Code: Select all

service httpd restart
If you’re using PHP-FPM :

Code: Select all

service php-fpm restart
To install APC/APCu :

APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.

Code: Select all

yum install php-pecl-apcu
After installation you need to restart Apache/php-fpm :

if you’re using Apache (mod_php) :

Code: Select all

service httpd restart
If you’re using PHP-FPM :

Code: Select all

service php-fpm restart
To install Memcached :

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

For PHP 5.xx

Code: Select all

yum install memcached memcached-devel php-pecl-memcache
For PHP 7.xx

Code: Select all

yum install memcached memcached-devel php-pecl-memcached
Start memcached Service :

Code: Select all

service memcached start
Start the memcached on boot :
Centos 6 :

Code: Select all

chkconfig memcached on
Centos 7 :

Code: Select all

systemctl enable memcached
After installation you need to restart Apache/php-fpm :

if you’re using Apache (mod_php) :

Code: Select all

service httpd restart
If you’re using PHP-FPM :

Code: Select all

service php-fpm restart
To install Redis :

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.

Code: Select all

yum install redis php-pecl-redis
Start Redis Service :

Code: Select all

service redis start
Start the Redis on boot :
Centos 6 :

Code: Select all

chkconfig redis on
Centos 7 :

Code: Select all

systemctl enable redis
After installation you need to restart Apache/php-fpm :

if you’re using Apache (mod_php) :

Code: Select all

service httpd restart
If you’re using PHP-FPM :

Code: Select all

service php-fpm restart

Re: [HowTo] Install PHP OPCache APC/APCu Memcached and Redis on VestaCP CentOS

Posted: Tue Mar 24, 2020 6:30 pm
by gogoi
my server is CentOS 6
with latest version of VestaCP - Php 7.3...

I got this error when I tried to install opcache. cany anyone help?

Code: Select all

 yum install php-opcache
error

Code: Select all

[root@host ~]# yum install php-opcache
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: asi-fs-n.contabo.net
Excluding mirror: mirror.nl.leaseweb.net
Excluding mirror: mirror.de.leaseweb.net
 * epel: ftp.nluug.nl
 * extras: centos.mirror.iphh.net
 * remi: remi.schlundtech.de
 * remi-php55: remi.schlundtech.de
 * remi-php56: remi.schlundtech.de
 * remi-safe: remi.schlundtech.de
 * remi-test: remi.schlundtech.de
 * updates: mirror.plusserver.com
Resolving Dependencies
--> Running transaction check
---> Package php-opcache.x86_64 0:5.6.40-19.el6.remi will be installed
--> Processing Dependency: php-common(x86-64) = 5.6.40-19.el6.remi for package: php-opcache-5.6.40-19.el6.remi.x86_64
--> Finished Dependency Resolution
Error: Package: php-opcache-5.6.40-19.el6.remi.x86_64 (remi-php56)
           Requires: php-common(x86-64) = 5.6.40-19.el6.remi
           Installed: php-common-7.3.16~RC1-1.el6.remi.x86_64 (@remi-php73-test)
               php-common(x86-64) = 7.3.16~RC1-1.el6.remi
           Available: php-common-5.3.3-49.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-49.el6
           Available: php-common-5.3.3-50.el6_10.x86_64 (updates)
               php-common(x86-64) = 5.3.3-50.el6_10
           Available: php-common-5.4.45-17.el6.remi.x86_64 (remi)
               php-common(x86-64) = 5.4.45-17.el6.remi
           Available: php-common-5.4.45-18.el6.remi.x86_64 (remi)
               php-common(x86-64) = 5.4.45-18.el6.remi
           Available: php-common-5.5.38-11.el6.remi.x86_64 (remi-php55)
               php-common(x86-64) = 5.5.38-11.el6.remi
           Available: php-common-5.5.38-12.el6.remi.x86_64 (remi-php55)
               php-common(x86-64) = 5.5.38-12.el6.remi
           Available: php-common-5.6.40-18.el6.remi.x86_64 (remi-php56)
               php-common(x86-64) = 5.6.40-18.el6.remi
           Available: php-common-5.6.40-19.el6.remi.x86_64 (remi-php56)
               php-common(x86-64) = 5.6.40-19.el6.remi
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


Re: [HowTo] Install PHP OPCache APC/APCu Memcached and Redis on VestaCP CentOS

Posted: Sun Jun 07, 2020 10:23 am
by vihatsoft
php-opcache:

Code: Select all

yum --enablerepo=remi-test install php74-php-opcache
memcache:

Code: Select all

yum --enablerepo=remi-test install memcached memcached-devel php74-php-pecl-memcache