-
Notifications
You must be signed in to change notification settings - Fork 33
Missing support for php 7.2 #19
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
Comments
See #11 for instructions on how to compile – Both PHP 7.1 and 7.2 are supported by the underlying modules, however binaries are provided by Amazon only for PHP 7.0 at this time. |
I've tried and it's not working. (see my comments re missing symbol strpprintf). It looks like this has changed in zend, and my C isn't good enough to understand what's going on. Also this comment (#11 (comment)) suggests that it isn't working for others. |
I just managed to install PHP 7.2 on ubuntu 16.04 and compile the client based on libmemcached 1.0.8. In case you need the binary to get unblocked, here it is. Let me know if this works for you or not. AmazonElasticacheClusterClient-PHP72-64bit-libmemcached-1.0.8.tar.gz |
@QuChen88 tested on PHP Version 7.2.5-1+ubuntu16.04.1 and it seems to be connecting and doing basics. Will have a better play later. |
On |
Part way through upgrading to PHP 7.2 on Amazon Linux and 💣 💥 turns out that AWS doesn't provide a client yet :-/ |
That said, @QuChen88's version above does seem to work for me on the latest Amazon Linux; any news when an "official" version would be available? |
Addendum, we're seeing a lot of logs with |
This worked for me.
@gergnz you should close this issue for the best answer of @QuChen88 |
I would say this should be verified on systems besides Ubuntu before closing. |
As the maintainer of the php-memcached module on which this work is based, I must urge against using older versions of libmemcached with known bugs and deficiencies.
What is the problem that is blocking the AWS modifications to libmemcached 1.0.18 from being used here?
|
@sodabrew, can you advise on these upstream changes please? |
Read five comments back, the error message says to use an updated library to avoid a specific bug. That text is meant to be as clear as possible in people’s error logs. |
is there an aws elastic client memcached for PHP 7.2 in amazon linux? |
|
It "works" for certain values of "works"; the stream of warnings reporting about To resolve this
|
My comments above are from using it on Amazon Linux @liaogz82; it installs and appears to work, but has a stream of warnings in the logs and the impact of that isn't clear to me. |
@elyobo how do you get the logs? I managed to get it working and on the surface seems to be ok |
Wherever your PHP logs go, and presumably also dependent on your error_reporting settings. |
How did you manage to compile it? Where's the source-tree with the modifications you needed to make, and where are the compile parameters documented? Thank you. |
Here's a Dockerfile for compiling on 7.2 FROM centos:7
RUN yum -y install epel-release
RUN yum -y update
RUN yum install -y wget git
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
RUN rpm -Uvh remi-release-7.rpm
RUN yum-config-manager --enable remi-php72
RUN yum update
RUN yum install -y php php-cli gcc gcc-c++ autoconf libevent-devel php-devel zlib-devel make
RUN mkdir /tmp/libmemcached \
&& cd /tmp/libmemcached \
&& git clone https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached.git
RUN cd /tmp/libmemcached/aws-elasticache-cluster-client-libmemcached \
&& touch configure.ac aclocal.m4 configure Makefile.am Makefile.in \
&& mkdir BUILD
WORKDIR /tmp/libmemcached/aws-elasticache-cluster-client-libmemcached/build
RUN ../configure --prefix=/tmp/libmemcached --with-pic
RUN make
RUN make install
WORKDIR /usr/lib64
RUN ln libsasl2.so.3 libsasl2.so.2
RUN ln libsasl2.so.3 libsasl2.so
RUN 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
WORKDIR /tmp/aws-elasticache-cluster-client-memcached-for-php/
RUN phpize
RUN ./configure --with-libmemcached-dir=/tmp/libmemcached --disable-memcached-sasl
RUN sed -i "s#-lmemcached#/tmp/libmemcached/lib/libmemcachedutil.a /tmp/libmemcached/lib/libmemcached.a -lcrypt -lpthread -lm -lstdc++ -lsasl2#" Makefile
RUN sed -i "s#-lmemcachedutil##" Makefile
RUN sed -i "s#-L/tmp/libmemcached/lib##" Makefile
RUN make |
@Seegras IIRC, I compiled it following the instructions I had in the README.markdown file. I launched an EC2 instance from AWS console using the standard Ubuntu AMI. |
Many thanks to @luishdz1010. I followed your Dockerfile and build my own RPM and PEAR package.
export HOME=/home/ec2-user
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
sudo yum -y install rpm-build java-1.8.0-openjdk
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
echo "%packager You <your@email>" >> ~/.rpmmacros
mkdir ~/src
cd ~/src
sudo yum install -y libevent-devel
wget https://github.com/awslabs/aws-elasticache-cluster-client-libmemcached/archive/v1.0.18.tar.gz
tar zxf v1.0.18.tar.gz
cd aws-elasticache-cluster-client-libmemcached-1.0.18 && mkdir BUILD && cd BUILD
../configure --prefix=/usr --libdir=/usr/lib64 --with-pic && make && make DESTDIR=/home/ec2-user/rpmbuild/SOURCES/libmemcached-1.0.18 install
cd ~/rpmbuild/SOURCES
rm libmemcached-1.0.18/usr/lib64/*.la
tar zcf libmemcached-1.0.18.tar.gz libmemcached-1.0.18
sed -i '/^%defattr/,$d' ../SPECS/libmemcached.spec && echo -e "%defattr(-,root,root,-)" >> ../SPECS/libmemcached.spec && find libmemcached-1.0.18 ! -type d ! \( -path 'libmemcached-1.0.18/usr/include/*' -o -path 'libmemcached-1.0.18/usr/lib64/pkgconfig/*' -o -path 'libmemcached-1.0.18/usr/share/man/man3/*' -o -path 'libmemcached-1.0.18/usr/share/aclocal/*' -o -path 'libmemcached-1.0.18/usr/lib64/*' \) -o -path 'libmemcached-1.0.18/usr/lib64/*.so.*' -o -path 'libmemcached-1.0.18/usr/lib64/*.a' | sed 's/^[^\/]*\//\//g' >> ../SPECS/libmemcached.spec && echo -e "\n%files devel\n%defattr(-,root,root,-)" >> ../SPECS/libmemcached.spec && find libmemcached-1.0.18 ! -type d \( -path 'libmemcached-1.0.18/usr/include/*' -o -path 'libmemcached-1.0.18/usr/lib64/pkgconfig/*' -o -path 'libmemcached-1.0.18/usr/share/man/man3/*' -o -path 'libmemcached-1.0.18/usr/share/aclocal/*' -o -path 'libmemcached-1.0.18/usr/lib64/*.so' \) | sed 's/^[^\/]*\//\//g' >> ../SPECS/libmemcached.spec
vi ../SPECS/libmemcached.spec
rm -rf libmemcached-1.0.18
rpmbuild -bb ../SPECS/libmemcached.spec
sudo rpm -Uvh ../RPMS/x86_64/libmemcached-1.0.18-1.amzn1.x86_64.rpm ../RPMS/x86_64/libmemcached-devel-1.0.18-1.amzn1.x86_64.rpm
cd ~/src
sudo yum install -y cyrus-sasl-devel php72-pecl-igbinary-devel
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 --disable-memcached-sasl --enable-memcached-igbinary --with-libmemcached-dir=/usr && make
tar zxf <somewhere>/AmazonElastiCacheClusterClient-2.0.3-PHP72-64bit.tgz
cp modules/memcached.so AmazonElastiCacheClusterClient-2.0.3/amazon-elasticache-cluster-client.so
vi package.xml
rm AmazonElastiCacheClusterClient-2.0.3-PHP72-64bit.tgz && tar zcf AmazonElastiCacheClusterClient-2.0.3-PHP72-64bit.tgz package.xml AmazonElastiCacheClusterClient-2.0.3/ Now you can install by |
We are moving to Ubuntu 18.04, and I was surprised to see the version for PHP 7.2 not downloadable directly from AWS yet. Considering PHP 7.2 was released over 1 year ago, and is the standard in Ubuntu's newest LTS, I am hoping it is coming soon. Are there plans to make this available for download, or provide instructions for compiling in 18.04? I have tried several different ways of compiling in 18.04 and I haven't had much success yet. |
Second jswinborne's comments. Been waiting for what seems like forever for this -- compilings not the end of the world but have had it cause a couple of hiccups with my moves to Amazon Linux 2. I would have thought the amazon-linux-extras option would have been perfect for this? Given its intended ease of use is somewhat logically questionable in the first place. |
@QuChen88 is this project officially supported by AWS? It's in the |
i managed to get it working under docker https://github.com/nkhine/centos-nginx-php72-fpm/blob/master/Dockerfile you can download the client for 7.2 from https://eu-west-1.console.aws.amazon.com/elasticache/home?region=eu-west-1#client-download: AWS Support just sent this: Coming back to your question with related to the PHP client version, Amazon officially provides the Elasticache Memcached Cluster Client PHP 7.0 and 7.2 now. The client version is available to download from the ElastiCache console under the section ElastiCache cluster clients. Unfortunately, I do noticed that the repo link provided do not get properly and apologize for the confusion it has been caused to you. Could you please check and update the client version to 7.2 to match your current PHP version. Once you have downloaded the required client version, please install the latest version of the ElastiCache PHP client. Please note that to update the php-memcached installation you need to remove the previous installation of the Memcached extension for PHP and install the new ElastiCache php-memcached extension as described here [2-3]. If you need any further assistance, please don't hesitate to reply to this case, I will be happy to assist you. Reference:[1] Installing the ElastiCache Cluster Client for PHP - https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/Appendix.PHPAutoDiscoverySetup.html |
PHP 7.2 is now supported and downloadable from AWS console. |
@QuChen88 is this 7.2 .so file compiled against libmemcached 1.0.8 or 1.0.18? |
The PHP 7.2 memcached client is now compiled against libmemcached 1.0.18. Please update if you had an older version. |
I have downloaded the latest version, libmemcached 1.0.18 . I have an issue on this after resetserverlist() the Memcached object is not supported properly. Anybody known this error? $m->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true); var_dump($m->addServer($host, $port, $weight)); Result is: After resetServerList() function is not working properly. But the same code is working correctly in php Memcached library. Please update anyone know this error. |
I'm not able to use the php7 branch to build against php7.2. While the build completes, the shared object can't be loaded due to a missing symbol, which looks to have changed between php 7.1 and php 7.2: strpprintf
The text was updated successfully, but these errors were encountered: