Need Help With Memcached Installation Errors

sharingsunshine
sharingsunshine used Ask the Experts™
on
I am encountering an error when I try to install memcached on a PHP 7 - Linux AWS system.  This is the command I am using that generates the error.
yum install memcached php-pecl-memcache

Open in new window


This is 1 of 2 errors:
1.
Finished Dependency Resolution
Error: Package: php-pecl-memcache-3.0.8-4.amzn2.x86_64 (amzn2-core)
           Requires: php(api) = 20100412-64

Open in new window


2.  
Error: Package: php-pecl-memcache-3.0.8-4.amzn2.x86_64 (amzn2-core)
           Requires: php(zend-abi) = 20100525-64

Open in new window


Please help me with how to finish installing memcached.

Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
What is output of...

php --version

Open in new window

Author

Commented:
[root@ip-172-31-8-214 httpd]# php --version
PHP 7.2.11 (cli) (built: Oct 24 2018 17:51:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
[root@ip-172-31-8-214 httpd]#
Fractional CTO
Distinguished Expert 2018
Commented:
Problem is...

You have PHP-7.2 installed which uses API version 20170718.

You're trying to install a memcached which uses 20100412 which is... wow... super old...

This would have to be PHP-5.4 or before.

Fix is for you to fix your repositories + remove all old repositories as PHP-7.2 won't mix with PHP-5.4 + having a broken repository setup like you have will likely cause other subtle problems which will be near impossible to debug.

Maybe get a list of memcached packages + look for something like...

memcached-php7.2

Open in new window


I stopped using RPM based systems years ago because of packaging nonsense like this, which is overly complex to figure out + fix.

Dig around in your package list + likely you'll find a memcached target/package to install which matches your PHP-7.2 version.
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Prabhin MPDevOps Engineer
Distinguished Expert 2018

Commented:
do
yum search php|grep memcache

check the package is available and install the same.

if you still have dependencies error do the same command for dependencies and install those.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Generally what Prabhin suggested is correct + in your case, you can't really do this... as easily as normal...

Because the memcached package you attempted to install above uses a PHP-5.4 API (20100412) version.

Your first step will be to audit all your repositories + remove those with outdated code.

The you should be able to install memcached as normal.

Author

Commented:
Thanks for pointing out this was an old API version.  I'll start over.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Likely best to get a list of your current repositories.

Then add latest LAMP stack repositories + remove old LAMP Stack repositories.

Once you get your repository list correct, you should be able to use default targets, like installing php-memcached + all will be well.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial