lampp php5.6 install redis via pecl - redis

I need to install redis on my lampp(php5.6.40) via pecl in mint 20
cd /opt/lampp/bin
sudo ./pecl install redis
but I got an error :
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/redis requires PHP (version >= 7.0.0), installed version is 5.6.40
can you help my to solve this issu, I need install redis on php5.6 because my project required php5.6 .

phpredis 5.x.x are drop PHP5 support
https://pecl.php.net/package-changelog.php?package=redis
try old version install.
pecl install redis-4.3.0

Related

Centos 8, PHP 7.2 and MS Sql Server

I am planning moving on to the Centos 8 but it seems that I cannot get a working PDO connection with SQL server using just plain Centos 8 packages.
I have installed the unixODBC packages and after that from PECL sqlsrv and sqlsrv_pdo but I can't figure out how to make the actual connection or odbc configuration.
As most of my code to be transferred to the new environments is written using PDO, I wouldn't want to change it to sql server native.
Are there any step-by-step instructions how to build PDO ODBC connection to sql server without using freetds, which isn't available through the centos repositories (or RHEL either).
I faced the same issue and I solved it as follow:
sudo dnf install php-pear
sudo dnf install php-devel
sudo dnf install make
sudo pecl install sqlsrv
sudo dnf install unixODBC-devel
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv
then:
sudo nano /etc/php.d/30-pdo_sqlsrv.ini
Add in the file 30-pdo_sqlsrv.ini:
extension=pdo_sqlsrv.so
then:
sudo nano /etc/php.d/20-sqlsrv.ini
Add in the file 20-sqlsrv.ini:
extension=sqlsrv.so
Download and install msodbcsql17-17.4.2.1-1.x86_64.rpm from https://packages.microsoft.com/rhel/8/prod/
sudo yum install msodbcsql17-17.4.2.1-1.x86_64.rpm
Then just need to restart php-fpm
sudo systemctl restart php-fpm.service
Good luck!

How to install specific apache version?

I developed one module for apache 2.4 server, I want to test my module with different apache versions.
I installed apache2.4 using following command.
apt-get -y install apache2
Can I install previous apache versions using apt-get?
You can install the package name with version number
apt-get install <packagename>=<complete version name>
The below command will show the list of versions
apt-cache showpkg <pachagename>

how install pdo-mysql in centos7

I install laravel 5 and then install packages neede.
I install php-pdo and some other but now i cant install pdo-mysql and laravel return error.
PDOException in PDOConnection.php line 47: could not find driver
I am use Centos 7 and PHP 5-6-29.
Check which package is installed (which provider) and provides the stack, then use the same namespace.
Webtatic uses php56w-*
IUS uses php56u-*
remi-safe (SCL packages) use php56-php-*
remi-php56 simply use php-*
other providers can use something else
As you need pdo_mysql driver, simply
yum install <namespace>-pdo_mysql
(using the ext name, yum will find the correct package name which provides this ext).
Also check you don't have any "exclude" lines in the yum configuration (such as the ones provided in altered cpanel distributions)
Try using this
yum install php-mysql
systemctl restart httpd
You can search package like
yum search php
Pick the ones you need and install them like this:
yum -y install php-mysqlnd php-pdo
In the next step I will install some common PHP modules that are required by CMS Systems like Wordpress, Joomla, and Drupal:
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel
https://webtatic.com/packages/php56/
I believe the driver is php56w-mysql so yum install php56w-mysql should do the job.

Ambari repository on CentOS 7

We are trying to install Ambari server following the manual Install Ambari 2.2.1 from Public Repositories.
When we tried to install the Ambari server with the command yum install ambari-server it returns that it is nothing to do.
The ambari.repo is:
#VERSION_NUMBER=2.2.1.0-161
[Updates-ambari-2.2.1.0]
name=ambari-2.2.1.0 - Updates
baseurl=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0
gpgcheck=1
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
Someone can help us?
The problem was that the OS installed was of 32 bits and it is obligatory install the 64 bits OS.
Just clear the yum cache and then try again it will be solved your problem.
yum clean all
yum install ambari-server
Note: Make sure you kept the ambari.repo file in /etc/yum.repos.d/ location
This happens in case:
Package (ambari-server) is already installed
Repolist can't find the package (ambari-server).
First run yum list all if it's not listing package then run
yum clean all
Again run yum list all
If it's not listing your package you need to add .repo file for the same in /etc/yum.repos.d

phpredis extension doesn't work, unable to load 'redis.so'

I installed nginx, php, php-fpm, php-pecl-redis by yum.
All of them work but the last one.
When I run /usr/sbin/php-fpm, I got this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/redis.so' - /usr/lib/php/modules/redis.so: undefined symbol: igbinary_unserialize in Unknown on line 0
I don't know what igbnary_unserialize means and how to fix it.
I checked the redis.so file under right path. I add extension=redis.so to php.ini
PHP version: 5.3.3
PhpRedis version: 2.2.7
I had the same issue. I'm on Ubuntu 16.04 LTS. Running sudo apt-get install php-igbinary resolved the issue for me. I have other issues, but that's what solved this one.
For people who are upgrading their php from 7.0 to 7.4 like me, and not able to get php-redis working. These are the steps I used after following the answers above.
1) remove Redis
sudo apt purge php-redis
2) Install Igbinary
sudo apt-get install php-igbinary
3) Install php-redis again
sudo apt-get install php-redis
I did the steps above because it seems only php7.0 is recognising the php-redis install but not the currently enabled php7.4
I also recommend removing other versions of PHP if you have should your problem continue unsolved.
Probably an issue with igbinary, is this installed? (try for example: cat /etc/php.d/igbinary.ini).
Here you can find and install igbinary
Related to this bug https://bugs.launchpad.net/ubuntu/+source/php-redis/+bug/1762935
You should remove php-redis from packages:
apt purge php-redis , and install it via pecl install redis
You should add "extension=redis.so" to php.ini
and remove redis from config.d in your php directory:
rm /etc/php/7.2/fpm/conf.d/#20-redis.ini
and
rm /etc/php/7.2/cli/conf.d/#20-redis.ini
restart php fpm and you will see that problem solved
On Ubuntu 20 and PHP 7.4
I did this and it worked :
sudo apt purge php-redis
sudo apt intall php-redis php7.4-redis
TEST redis server :
$ php --ri redis
or
$ redis-cli ping
$ redis-cli info stats
just resolve the same problem:
php-pecl-redis installed by yum will cause this problem.
so you need to install the php-redis manually. wget the package and phpize - configure - make ....