Control Web Panel

WebPanel => PHP Selector => Topic started by: venty on July 30, 2018, 10:00:21 AM

Title: Add modules with PHP selector
Post by: venty on July 30, 2018, 10:00:21 AM
Hi,

my main version of the PHP of the panel is 7.2.7 ... For several reasons I have to use a version of PHP 5.6 that I installed with the PHP selector, but I need to add modules such as redis, memcached and other. ..

How can I do that?!?

Thanks in advance!

BR
Venty
Title: Re: Add modules with PHP selector
Post by: studio4host on July 30, 2018, 01:41:36 PM
you can do that custom after php build, you can check how php switch has this in the folder

/usr/local/cwpsrv/htdocs/resources/conf/php_switcher/external_modules/
Title: Re: Add modules with PHP selector
Post by: venty on July 30, 2018, 04:56:12 PM
Hi,

We are talking about PHP selector , not about PHP switcher...
File redis and memcached are in the folder:

/usr/local/cwpsrv/htdocs/resources/conf/php_switcher/external_modules/

 but are not listed in the installed modules of the PHP  version 5.6 installed by the PHP selector...???

BR
Venty
Title: Re: Add modules with PHP selector
Post by: venty on July 31, 2018, 04:43:01 PM
:)
Title: Re: Add modules with PHP selector
Post by: studio4host on August 01, 2018, 11:51:37 AM
you can check php switcher scripts and modify it to build php-selector php versions...note you need to know what to edit...so it's not for a beginner....anyway any system admin can do that or if you have no system admin then cwp support.
Title: Re: Add modules with PHP selector
Post by: venty on August 01, 2018, 05:26:11 PM
Hi,

PHP selector where?

BR
Venty
Title: Re: Add modules with PHP selector
Post by: studio4host on August 02, 2018, 01:31:52 PM
you need to check eternal_modules of the php switcher so you would know how to modify the scripts to work with php selector..
Title: Re: Add modules with PHP selector
Post by: venty on August 03, 2018, 11:59:23 AM
Hi,

Adding modules can not be done before compiling the given version of the PHP by the PHP selector to select the appropriate menu Edith flag ( go to PHP flag editor), set the:

--enable-memcached
--enable-redis

save the changes, and then start the compilation???

Thanks in advance!

BR
Venty
Title: Re: Add modules with PHP selector
Post by: venty on August 07, 2018, 05:39:24 PM
???
Title: Re: Add modules with PHP selector
Post by: bullten on August 08, 2018, 01:30:56 AM
Why dont you manually install the modules you need?
Title: Re: Add modules with PHP selector
Post by: bullten on August 08, 2018, 02:07:49 AM
Like if you have php5.6 as your alternate php version. The paths are as below.

Code: [Select]
/opt/alt/php56/usr/bin/php
/opt/alt/php56/usr/bin/pecl
/opt/alt/php56/usr/bin/php-config
/opt/alt/php56/usr/bin/phpize
/opt/alt/php56/usr/php/php.ini

So to install redis to it, i will do

Code: [Select]
/opt/alt/php56/usr/bin/pecl install redis
Now enable its module in your phpini

Code: [Select]
echo "extension=redis.so" >> /opt/alt/php56/usr/php/php.ini
Check if module is loaded

Code: [Select]
[root@cwp7 ~]# /opt/alt/php56/usr/bin/php -i | grep redis
redis
Registered save handlers => files user redis rediscluster
This program is free software; you can redistribute it and/or modify


Your can replace php56 with the version you have installed. Like if you have 7.1 use php71. So in that case path of your files will be

Code: [Select]
/opt/alt/php71/usr/bin/php
/opt/alt/php71/usr/bin/pecl
/opt/alt/php71/usr/bin/php-config
/opt/alt/php71/usr/bin/phpize
/opt/alt/php71/usr/php/php.ini
Title: Re: Add modules with PHP selector
Post by: venty on September 04, 2018, 04:04:49 PM
memcached?
Title: Re: Add modules with PHP selector
Post by: bullten on September 04, 2018, 04:33:47 PM
Something like this will do it

Quote
yum install memcached -y
/opt/alt/php56/usr/bin/pecl install memcache
echo "extension=memcache.so" >> /opt/alt/php56/usr/php/php.ini
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
chkconfig memcached on

Quote
/opt/alt/php56/usr/bin/php -i | grep memcache
Title: Re: Add modules with PHP selector
Post by: Sandeep on September 05, 2018, 01:02:39 PM
Hi,

my main version of the PHP of the panel is 7.2.7 ... For several reasons I have to use a version of PHP 5.6 that I installed with the PHP selector, but I need to add modules such as redis, memcached and other. ..

How can I do that?!?

Thanks in advance!

BR
Venty
try this guide
https://www.mysterydata.com/how-to-install-memcached-and-redis-php-extensions-with-php-selector-5-6-7-0-7-1-7-2-cwp-centos-webpanel/
Title: Re: Add modules with PHP selector
Post by: venty on September 10, 2018, 02:11:58 PM
Like if you have php5.6 as your alternate php version. The paths are as below.

Code: [Select]
/opt/alt/php56/usr/bin/php
/opt/alt/php56/usr/bin/pecl
/opt/alt/php56/usr/bin/php-config
/opt/alt/php56/usr/bin/phpize
/opt/alt/php56/usr/php/php.ini

So to install redis to it, i will do

Code: [Select]
/opt/alt/php56/usr/bin/pecl install redis
Now enable its module in your phpini

Code: [Select]
echo "extension=redis.so" >> /opt/alt/php56/usr/php/php.ini
Check if module is loaded

Code: [Select]
[root@cwp7 ~]# /opt/alt/php56/usr/bin/php -i | grep redis
redis
Registered save handlers => files user redis rediscluster
This program is free software; you can redistribute it and/or modify


Your can replace php56 with the version you have installed. Like if you have 7.1 use php71. So in that case path of your files will be

Code: [Select]
/opt/alt/php71/usr/bin/php
/opt/alt/php71/usr/bin/pecl
/opt/alt/php71/usr/bin/php-config
/opt/alt/php71/usr/bin/phpize
/opt/alt/php71/usr/php/php.ini

Hi,

I want to ask:

1. If I already have a redis installed and compiled with PHP switcher, do I need to install  it again with
Code: [Select]
/ opt / alt / php56 / usr / bin / pecl install redis    ?

2. When installing it with

Code: [Select]
/ opt / alt / php56 / usr / bin / pecl install redis
only the alternative PHP 5.6 is installed and does not affect the PHP version and modules for the sites and PHP version and modules for CWP?

3. In the beginning when I started the

Code: [Select]
/opt/alt/php56/usr/bin/pecl install redis I received the following message:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading redis-4.1.1.tgz ... ?

4. When the installation started, he asked me twice:

enable igbinary serializer support? [no]: no
enable lzf compression support? [no]: no

and I answered "No" - is it right?

5. As far as I understand, if I want for another version I repeat the same with other folders ??

Thanks in advance!

BR
Venty
Title: Re: Add modules with PHP selector
Post by: bullten on September 12, 2018, 05:11:29 AM
Quote
If I already have a redis installed and compiled with PHP switcher, do I need to install  it again with

yes

Quote
only the alternative PHP 5.6 is installed and does not affect the PHP version and modules for the sites and PHP version and modules for CWP?

yes

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading redis-4.1.1.tgz ... ?
Quote
4. When the installation started, he asked me twice:

enable igbinary serializer support? [no]: no
enable lzf compression support? [no]: no

and I answered "No" - is it right?

yes, default is no but you can change as you wish to.

Quote
As far as I understand, if I want for another version I repeat the same with other folders ??

yes



Title: Re: Add modules with PHP selector
Post by: venty on September 12, 2018, 05:39:48 AM
Hi,

thank you for the answer, but this question did not make it clear to me:
to ask:


3. In the beginning when I started the

Code: [Select]
/opt/alt/php56/usr/bin/pecl install redis
I received the following message:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading redis-4.1.1.tgz ... ???

Thanks in advance!

BR
Venty


Title: Re: Add modules with PHP selector
Post by: bullten on September 12, 2018, 05:48:52 AM
Run this command and try again

Code: [Select]
pecl channel-update pecl.php.net
Title: Re: Add modules with PHP selector
Post by: venty on September 12, 2018, 06:14:46 AM
Something like this will do it

Quote
yum install memcached -y
/opt/alt/php56/usr/bin/pecl install memcache
echo "extension=memcache.so" >> /opt/alt/php56/usr/php/php.ini
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
chkconfig memcached on

Quote
/opt/alt/php56/usr/bin/php -i | grep memcache

Hi,

here for the quoted codes to get it should not be for a memcached also for a folder /opt/alt/php56/usr/bin/???
 
Аnd do I need to install again, provided I installed it once more to compile it with the PHP Version Switcher v2 for the basic version that is 7.2.9??

Аnd if I want to install on a higher alternative version of a PHP with CWP PHP Selector, say 7.1, everything is repeated with the same codes and sequence?

BR
Venty
Title: Re: Add modules with PHP selector
Post by: bullten on September 12, 2018, 06:34:30 AM
any alternate php version you want to use you have to compile for it.
Title: Re: Add modules with PHP selector
Post by: venty on September 12, 2018, 07:02:18 AM
Something like this will do it

Quote
yum install memcached -y
/opt/alt/php56/usr/bin/pecl install memcache
echo "extension=memcache.so" >> /opt/alt/php56/usr/php/php.ini
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
chkconfig memcached on

Quote
/opt/alt/php56/usr/bin/php -i | grep memcache

Hi,

here for the quoted codes to get it should not be for a memcached also for a folder /opt/alt/php56/usr/bin/???
 
Аnd do I need to install again, provided I installed it once more to compile it with the PHP Version Switcher v2 for the basic version that is 7.2.9??

Аnd if I want to install on a higher alternative version of a PHP with CWP PHP Selector, say 7.1, everything is repeated with the same codes and sequence?

BR
Venty


OK, but...

the installation of memcached also for a folder /opt/alt/php56/usr/bin/???  and each row of codes one after the other to run them??

Аnd do I need to install and adjust again memcached, provided I installed it once more to compile it with the PHP Version Switcher v2 for the basic version that is 7.2.9??

Title: Re: Add modules with PHP selector
Post by: bullten on September 16, 2018, 06:31:00 AM
You need to install php version of memcache/memcached  for all versions of php.
Title: Re: Add modules with PHP selector
Post by: venty on September 16, 2018, 08:40:24 AM
Hi.

yum install memcached -y
/opt/alt/php56/usr/bin/pecl install memcache
echo "extension=memcache.so" >> /opt/alt/php56/usr/php/php.ini
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
chkconfig memcached on


i want to install a memcache (memcached???) for just about the alternative version 5.6 of the PHP ... all the commands listed above should I install  and all together or sequentially one after the other??

Thanks in advance!

BR
Venty