-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing support for PHP7.1 #11
Comments
We need this, too. We want to hitch our wagon to Elasticache, but we need to know that this module will keep up with PHP releases. Given how long PHP releases are in beta, it shouldn't be too much to ask to have this module updated within a week or two of the release, should it? |
I opened a support ticket with AWS, and I got this most unhelpful response:
My contention is that I'm not looking for support with PHP per se, but I'm looking for support on a client library for PHP that was built and maintained by AWS. Or AWS Labs, anyway. |
Hello, Try the release |
b55106b looks promising |
We have just recently merged most recent fixes from the upstream. Please make sure you are using the latest |
Thanks for the update! |
@malyeyev-AMZN The file on S3 at ClusterClient/PHP-7.0/latest-64bit only includes a PHP 7.0 build. I don't see a corresponding download at ClusterClient/PHP-7.1/latest-64bit built for PHP 7.1. Note that the PHP API version was updated and extensions must be recompiled. |
Please release a binary compiled against the PHP 7.1 API. My attempts to build this thing myself have so far been disastrous. |
@Pierozi - how did you get this to work with PHP 7.1.1? Did you compile it yourself? I had problems with the recent upstream merge that I thought I was able to work around, but then I ran into this issue: libmemcached.so.10: cannot open shared object file: No such file or directory in Unknown on line 0 |
@jpriebe: if you could provide what kind of Linux you're trying to compile it on and exact steps and commands you're using, we might be able to help |
These steps worked for me on Ubuntu 16.04 AMI (
Please let me know if this works for you! |
Also, this:
makes me think that you compile the library on one host and then copy it to another that does not have ElastiCache libmemcached (or plain libmemcached for that matter) installed. To statically build in libmemcached into the php module you need to also run this command between
|
Here's what I did:
|
Using a modified version of the script above and AWS Centos 7 ami (ami-6d1c2007) I was able to build a working client. The additional changes to the Makefile prevent the following error:
#!/bin/sh
####
#### Builds aws-elasticache-cluster-client-memcached-for-php for PHP 7.1 on CentOS 7
#### (libmemcached is statically linked into the module binary)
####
#### assumes your repo is configured to install PHP 7.1 (use Remi's repo!). Just
#### in case you aren't familiar, here's how you do that:
####
#### ---------------------------------------------------------------------------
#### cd /tmp
#### wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
#### sudo rpm -Uvh remi-release-7.rpm
#### sudo yum-config-manager --enable remi-php71
#### sudo yum install -y php php-cli
#### ---------------------------------------------------------------------------
####
#### client module build instructions were patterned after this guide:
#### http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Appendix.PHPAutoDiscoveryCompile.html
####
yum -y install epel-release
yum -y update
yum install -y wget git
#### PHP
yum install -y libxslt libpng libXpm fontconfig
cd /tmp
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm
yum-config-manager --enable remi-php71
yum install -y php php-cli
yum install -y gcc gcc-c++ autoconf libevent-devel php-devel zlib-devel
cd /tmp
mkdir /tmp/libmemcached
git clone https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached.git
cd aws-elasticache-cluster-client-libmemcached
#### roll back to before 1.0.18 upstream was merged; this broke the build
#### https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached/issues/8
git checkout fb9a57250aebca26653ff4b294fd2377ae1eb0f1
mkdir BUILD
cd BUILD
../configure --prefix=/tmp/libmemcached --with-pic
make
make install
#### sasl2 could not be found without 2nd symlink below
cd /usr/lib64
ln libsasl2.so.3 libsasl2.so.2
ln libsasl2.so.3 libsasl2.so
cd /tmp
git clone https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php.git
cd aws-elasticache-cluster-client-memcached-for-php
git checkout php7
phpize
./configure --with-libmemcached-dir=/tmp/libmemcached --disable-memcached-sasl
sed -i "s#-lmemcached#/tmp/libmemcached/lib/libmemcachedutil.a /tmp/libmemcached/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++ -lsasl2#" Makefile
sed -i "s#-lmemcachedutil##" Makefile
sed -i "s#-L/tmp/libmemcached/lib##" Makefile
make
cp modules/memcached.so /tmp/amazon-elasticache-cluster-client.so |
I have not be a able to build it with any of the suggestions appears here, Please release a binary compiled against the PHP 7.1.7 API. This is very frustrating... Is there any other workaround for PHP 7.1.7? Note: I'm using Beanstalk. Thanks in advance |
I am also looking for a PHP 7.1 binary. I tried https://s3.amazonaws.com/elasticache-downloads/ClusterClient/PHP-7.0/latest-64bit, however this fails to install on PHP 7.1 (using Beanstalk, similar to @fenixkim). @fenixkim - were you able to get this working on an Elastic Beanstalk image? |
@BobDankert unfortunately not, we really need the binary file for the latest php versions. For my project, I installed the memcached php module using a .ebextensions config file. So the service will run in each instances created. But this limit to use the autodiscover feature suggested by aws. I’m not an expert in this, but if you need I can sent the example of my config files. I know that this is very fruatranting, so I really would like to offer you any help. Let me know |
I was able to get the cluster client installed using most of the steps listed by @pabdavis. I haven't had a chance to test it yet, but the module is installed in PHP now and I will be running testing later today. I am using the latest PHP 7.1 EB AMI for my machine, and skipped all of the "yum install" commands that pabdavis listed above, except you do need to run "sudo yum install libevent-devel". Also, make sure to remove the current PHP memcached libraries: "sudo yum remove php71-pecl-memcache.x86_64 php71-pecl-memcached.x86_64". Instead of the ln commands that pabdavis listed, I ran these commands: "ln libsasl2.so.2 libsas12.so.3" and "ln libsasl2.so.2 libsas12.so". I also did not need to run any of the "sed" commands. I ran "make" and "make install" at the end, then added a ini file to "/etc/php-7.1.d" with "extension=memcached.so" in the file, to load the extension. It is now showing |
Oh, great!! I’m going to follow your steps ASAP. However if you write here all the commands in the order your uses or the .config file it would be really great! Many thanks!! |
I'm working on documenting my steps from beginning to end. I'll post them when I get everything set. |
Here are the steps I went through on a fresh instance with nothing else done on the instance: Build based on AMI: aws-elasticbeanstalk-amzn-2017.03.1.x86_64-php71-hvm-201709200829 (ami-c605eabc)
Again, a big thanks to @pabdavis for posting his process to getting it to work on his machine. I still haven't put this live yet and run it through all of the testing - that will take a few days. I'll post if there are any issues with this in our environment. |
Instead of messing around and compiling it yourself, here is a version that I made. Should be able to install it with
Hope this helps. |
I've recently released php-memcached 3.0.4 (see https://pecl.php.net/package/memcached/3.0.4), which fixes a memory corruption bug under high load, and supports PHP 7.0, 7.1, and now 7.2 as well. Would be great to see this downstream build available for all three PHP 7.x versions. (PHP 7.2.0 is due on Nov 30, 2017). |
In our case is easier to put the fixed list of nodes in our app instead of wasting time to compiling for PHP 7.1.12. Or use the compiled version from @garrows! Thanks! |
+1 for official Elasticache extension builds compatible with PHP 7.1 and 7.2. 😊 |
@garrows I am trying your compiled version of the cluster client. But still getting the error below. I'm on php 7.1.14 Any ideas?? PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/amazon-elasticache-cluster-client.so' - libsasl2.so.2: cannot open shared object file: No such file or directory in Unknown on line 0 Any help is much appreciated!!! |
@airinaga So you need libsasl2.so to be installed. |
@sodabrew Sorry for being lame, but how would this get installed on a RHEL box? I see above people used apt-get to install.. Doesn't look like yum has the same package. Or does this need to be built from source? Thanks, |
Yum has the same package. I don't have a RHEL account to confirm the same version (i.e. libsasl2.so.2) but Fedora has this package: https://apps.fedoraproject.org/packages/cyrus-sasl-lib/ |
So here are the symlinks I have in /usr/lib64/ ... libsasl2.so -> libsasl2.so.3.0.0 I feel like I have the correct packages linked, attempting the symlink from solutions above would only create a symlink to a symlink. Ex: (ln libsasl2.so.2 libsasl2.so) Still getting a 'cannot create session ID' Any ideas? Thanks, |
Well... I used to do 7.0 on Elastic Beanstalk via:
That's now totally busted. Anyone know how to get this going with 7.1? Thanks a TON! :) |
@QuChen88 @danzamansky @hyandell - When will this be updated to support PHP 7.2? |
I've tried compiling it for PHP 7.2 on Alpine 3.7. It's finishing without any errors but fails to load the library with an error about a missing symbol
I'm compiling it against PHP 7.1 now. Will give feedback if it fails again. UPDATE: And it fails with same error for PHP 7.1. Testing with PHP 7.0 now UPDATE 2: After changing the order of extensions to load php_session before memcached it's now working at least for PHP 7.2. |
Sounds like insane amount of activities are going on in PHP 7.x land. I will see what work is to create a PHP 7.2 artifact. |
Hey @QuChen88 did you have much luck with this? |
Yes I managed to build the PHP 7.2 client artifact on ubuntu 16.04 with libmemcached v1.0.8. Didn't have much luck with 1.0.18 for some reason... See #19 |
Excuse me, but could anyone please help me with this error? I have deployed a Bitnami wordpress app on Ubuntu 16.04. and a memcached instance. When I installed the PHP memcached client extension, it still progressed and some missing header error occured with. I followed the instruction in the official AWS website, link below: https://aws.amazon.com/vi/elasticache/memcached/wordpress-with-memcached/ However, I cannot access the website after server reboot. I restart apache services and get the error about unmatching modules mentioned above. I tried to remove .so file and delete the "echo" line in php.ini file, but I still cannot get my site back online. Though I can use sftp and ssh to it, I cannot access it via public IP. I also restarted the Ec2 instance, double checked the newly assigned IP as well as Internet gate way, route table and so on, everything is fine. My wordpress installation is fresh, no plugin or modifying. I tried with another instance and it's gone the same way. Now I just want to undo the memcached extension installation and my site return as before. I am very thankful for your help. |
Here is a PHP 7.1 compiled version built against libmemcached 1.0.18 (so seems to contain the memory fixes etc). |
When is support for PHP7.1 expected to arrive?
Classic php7.0-dev build I'd guess.
The text was updated successfully, but these errors were encountered: