MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Tips and Tricks => Topic started by: xamer on 2016-09-24, 10:22:21

Title: PHP Accelerator
Post by: xamer on 2016-09-24, 10:22:21
Hello
What kind of PHP Accelerator i can install in Kloxo-MR and how?
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-24, 10:53:41
Go to 'admin > php modules status' and then click 'enable' apcu (if not exists select apc). And then click 'restart'. Better enable for every 'php target'.
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 11:10:48
Hm.
But there is no apc in PHP Module Status. No xcache and etc
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-24, 11:38:24
Add 'apc' in 'seach' of 'php module status' and then you will see apc/apcu.

Remember, it's only exists in Kloxo-MR 7.0
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 12:09:54
Using Kloxo-MR 7.0.0.b-2016092301
Added 'apc' in 'seach' of 'php module status' and nothing
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-24, 12:17:37
Using Kloxo-MR 7.0.0.b-2016092301
Added 'apc' in 'seach' of 'php module status' and nothing
Click 'showall' first and then add 'apc' and click 'looking glass' icon.

Remember, only 'multiple php' already installing all modules. You need install separately for 'php branch' (aka 'php' in 'target' at 'php module status').
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 12:26:55
Done, but  there is no apc in PHP Module Status.
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 13:03:23
I installed several phps in Multiple php and now apc is in PHP Module Status. Also there are xcache, memcached, can i use them?

Can I use different types of php for different users? Or I have to choose only one as PHP Used?
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-24, 13:39:34
In Kloxo-MR 7.0 terms, 'php branch' is php installed using 'yum install' (only possible 1 version at the same times).

'multiple php' (need enable 'Multiple PHP Enable (for 'php-fpm') ' in 'admin > servers > localhost > php configure') are php installed using 'special treatment' (possible multiple php at the same times).

'php used' is 'default php version' if not selected other version for certain domain.

In Kloxo-MR 7.0, possible using different version for every domain via 'admin > all > all domains > (select one) > web features'.

Apc/apcu are the same functions (target to php opcode) with xcache and opcache  where memcached/redis are cache different functions (target to database).
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 14:19:11
OMG. It is so GREAT! I'll try everything.
Thank you very much
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 15:06:05
Apc/apcu are the same functions (target to php opcode) with xcache and opcache  where memcached/redis are cache different functions (target to database).
I understand these differences. I enabled apc as php Accelerator.

But also i need a memecached server. I enabled php modules for this, but how can i install a memecached server safety?
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-24, 15:13:04
Run 'yum install memcached -y' if enable memcached module for php.
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-24, 15:33:45
Everything is fine.
Completely done.
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-26, 01:38:11
Well, i have one more question.
I've got php 5.5.38 as PHP Branch. I use multiple php for domains and memcached enabled and everithing works fine. But if i run php script with cron tasks it doesn't work, because memcached extension is not instaled for php branch.
How can i solve the problem?
I tried to install it by
yum install php-pecl-memcache php-pecl-memcached -y
they didn't install giving conflits errors.
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-26, 02:44:42
If using php 5.5 as 'php branch', try 'yum install php55u-pecl-memcached -y'.
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-26, 03:22:42
Thank you.
I had to install php 5.3.29 as 'php branch', so i'll install pecl-memcached using your example...
But can you tell me as an experienced person, may be it is better to use 'apc' as object cache instead of memcache? I found many opinions in that case. What do you prefer?
Title: Re: PHP Accelerator
Post by: MRatWork on 2016-09-26, 03:56:30
Thank you.
I had to install php 5.3.29 as 'php branch', so i'll install pecl-memcached using your example...
But can you tell me as an experienced person, may be it is better to use 'apc' as object cache instead of memcache? I found many opinions in that case. What do you prefer?
Apc/apcu and memcache/memcached are different cache functions where apcu is advanced/latest version of apc and memcached is advanced/latest version of memcached.

So, you can combining between apc and memcache, apc and memcached, apcu and memcache or apcu and memcached.
Title: Re: PHP Accelerator
Post by: xamer on 2016-09-26, 13:03:51
Thank you.
I figured out now.
Title: Re: PHP Accelerator
Post by: xamer on 2017-03-27, 08:26:55
How can I use memcache for PHP7?

I use multiple php, and there is no memcached module for php7 in "PHP Module Status", only php53, php55, php56 and it works fine for them


CentOS6, Kloxo-MR 7.0.0.c-2017031002
Title: Re: PHP Accelerator
Post by: MRatWork on 2017-03-29, 12:05:26
Modules in Php 7.0/7.1 still uncomplete. With 'multiple php', Kloxo-MR install all possible cores and modules in php.
Title: Re: PHP Accelerator
Post by: xamer on 2019-09-29, 00:28:56
Well, there are modules are ready for php7 as i see - https://github.com/php-memcached-dev/php-memcached
Will you add them to Kloxo?
Title: Re: PHP Accelerator
Post by: MRatWork on 2019-09-29, 01:50:59
Yes, already now. Enable via 'php modules status'.
Title: Re: PHP Accelerator
Post by: xamer on 2019-09-29, 12:45:15
I suppose i have to update Kloxo-MR 7.0.0.c-2017031002 for this
But i scare to do this :) Everything works so fine )))))
Quote
yum clean all
yum update -y
sh /script/cleanup

Thank you.