Skip to content

php7 branch #194

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

Closed
pjebs opened this issue Nov 10, 2015 · 9 comments
Closed

php7 branch #194

pjebs opened this issue Nov 10, 2015 · 9 comments

Comments

@pjebs
Copy link

pjebs commented Nov 10, 2015

I ran this code below:

`
git clone https://github.com/php-memcached-dev/php-memcached

cd php-memcached

git checkout php7

phpize

./configure

make

sudo make install
`

It didn't work. The response is below:

make
make: *** No targets specified and no makefile found. Stop.

@isotopp
Copy link

isotopp commented Nov 10, 2015

Is the phpize command you are calling a phpize from PHP 7? Because if you checkout the php7 branch of php-memcached, the phpize must match.

(The sequence does work for me with a self-build php7, a php7 phpize from the same build and as shown by you)

@isotopp
Copy link

isotopp commented Nov 10, 2015

[kris@kk2:~/Source/php-memcached] php7* ± which phpize
/opt/php/bin/phpize

[kris@kk2:~/Source/php-memcached] php7* ± which php
/opt/php/bin/php

[kris@kk2:~/Source/php-memcached] master* ± php -v
PHP 7.1.0-dev (cli) (built: Nov  9 2015 20:19:56) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

[kris@kk2:~/Source/php-memcached] master* ± git checkout php7
Switched to branch 'php7'
Your branch is up-to-date with 'origin/php7'.

[kris@kk2:~/Source/php-memcached] php7* ± phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

[kris@kk2:~/Source/php-memcached] php7* ± ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8/
...
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged

[kris@kk2:~/Source/php-memcached] php7* 3s ± make -j 4
...
cp ./.libs/memcached.so /Users/kris/Source/php-memcached/modules/memcached.so
cp ./.libs/memcached.lai /Users/kris/Source/php-memcached/modules/memcached.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Users/kris/Source/php-memcached/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

[kris@kk2:~/Source/php-memcached] php7* ± make install
Installing shared extensions:     /opt/php/lib/php/extensions/no-debug-non-zts-20151012/

@jonathanpmartins
Copy link

@isotopp @mkoppanen @krakjoe

I think my compilation is not right too. I can compile the php7 branch, but the make test command fails. The list is very long! If you are interesting, I can put it in another comment.

When I run make install it seems that the extension is installed correctly.

php -v
PHP 7.0.2-4+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
php -i | grep memcached
memcached
memcached support => enabled
libmemcached version => 1.0.18
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.compression_type => fastlz => fastlz
memcached.serializer => php => php
memcached.sess_binary_protocol => 1 => 1
memcached.sess_compression => 1 => 1
memcached.sess_connect_timeout => 0 => 0
memcached.sess_consistent_hash => 1 => 1
memcached.sess_lock_expire => 0 => 0
memcached.sess_lock_max_wait => not set => not set
memcached.sess_lock_retries => 5 => 5
memcached.sess_lock_wait => not set => not set
memcached.sess_lock_wait_max => 2000 => 2000
memcached.sess_lock_wait_min => 1000 => 1000
memcached.sess_locking => 1 => 1
memcached.sess_number_of_replicas => 0 => 0
memcached.sess_persistent => 0 => 0
memcached.sess_prefix => memc.sess. => memc.sess.
memcached.sess_randomize_replica_read => 0 => 0
memcached.sess_remove_failed_servers => 0 => 0
memcached.sess_sasl_password => no value => no value
memcached.sess_sasl_username => no value => no value
memcached.sess_server_failure_limit => 0 => 0
memcached.store_retry_count => 2 => 2

The script I make to install everything from scratch is here: https://github.com/jonathanpmartins/ubuntusetup/blob/master/server/setup-php7-nginx-1.9.10-ubuntu-14.04.sh. Ignore the apt-get install php-memcached command on the shell, I suppress it!

Ending... My unit test dont pass. I cannot set any property. Seems like the extension is not working properly yet. Can I help with something?

@jonathanpmartins
Copy link

@isotopp @mkoppanen @krakjoe
I forgot to mention.

version 3.0.0b1

@mkoppanen
Copy link
Member

@jonathanpmartins,

when you do 'make test' do you have memcached running on 127.0.0.1:11211?

@oerdnj
Copy link

oerdnj commented Mar 6, 2016

@pjebs If you are using my ppa, why you just don't apt-get install php-memcached?

@jonathanpmartins
Copy link

@mkoppanen Sorry for come nearly 1 month later, but my jobs makes me fly.

I get It work, Lets begin:

  • First I create a new instance (in my case, aws) with a fresh default Ubuntu Server 14.04 LTS
  • After Log-in, I follow this commands: (The script will take a wile to complete)
ubuntu@host:~$ wget https://raw.githubusercontent.com/jonathanpmartins/ubuntusetup/master/server/setup-php7-nginx-1.9.10-ubuntu-14.04-without-memcached.sh;
ubuntu@host:~$ sudo chmod +x setup-php7-nginx-1.9.10-ubuntu-14.04-without-memcached.sh;
ubuntu@host:~$ sudo ./setup-php7-nginx-1.9.10-ubuntu-14.04-without-memcached.sh;
  • After the first round I proceed to the memcached preparation, download, compilation and installation.
ubuntu@host:~$ which phpize;
/usr/bin/phpize
ubuntu@host:~$ which php
/usr/bin/php
ubuntu@host:~$ php -v
PHP 7.0.4-3+deb.sury.org~trusty+4 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
ubuntu@host:~$ wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
ubuntu@host:~$ tar -zxvf libmemcached-1.0.18.tar.gz
ubuntu@host:~$ cd libmemcached-1.0.18/
ubuntu@host:~/libmemcached-1.0.18$ ./configure
ubuntu@host:~/libmemcached-1.0.18$ make; # (will take a while)
ubuntu@host:~/libmemcached-1.0.18$ sudo make install;
ubuntu@host:~/libmemcached-1.0.18$ cd ..
ubuntu@host:~$ rm libmemcached-1.0.18.tar.gz
ubuntu@host:~$ rm -rf libmemcached-1.0.18/
  • At this point, everything seem to work, I continue:
ubuntu@host:~$ git clone [email protected]:php-memcached-dev/php-memcached.git
ubuntu@host:~$ cd php-memcached/
ubuntu@host:~/php-memcached$ git checkout php7
ubuntu@host:~/php-memcached$ phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
ubuntu@host:~/php-memcached$ ./configure
ubuntu@host:~/php-memcached$ make
----------------------------------------------------------------------
Libraries have been installed in:
   /home/ubuntu/php-memcached/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.
ubuntu@host:~/php-memcached$ make test
/bin/bash /home/ubuntu/php-memcached/libtool --mode=install cp ./memcached.la /home/ubuntu/php-memcached/modules
libtool: install: cp ./.libs/memcached.so /home/ubuntu/php-memcached/modules/memcached.so
libtool: install: cp ./.libs/memcached.lai /home/ubuntu/php-memcached/modules/memcached.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin" ldconfig -n /home/ubuntu/php-memcached/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /home/ubuntu/php-memcached/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /usr/bin/php7.0 
PHP_SAPI    : cli
PHP_VERSION : 7.0.4-3+deb.sury.org~trusty+4
ZEND_VERSION: 3.0.0
PHP_OS      : Linux - Linux ip-172-31-47-127 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64
INI actual  : /home/ubuntu/php-memcached/tmp-php.ini
More .INIs  :   
CWD         : /home/ubuntu/php-memcached
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   14
---------------------------------------------------------------------

Number of tests :  126               115
Tests skipped   :   11 (  8.7%) --------
Tests warned    :    1 (  0.8%) (  0.9%)
Tests failed    :   17 ( 13.5%) ( 14.8%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   97 ( 77.0%) ( 84.3%)
---------------------------------------------------------------------
Time taken      :   18 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Memcached::casByKey() [tests/experimental/cas_bykey.phpt]
Memcached::cas() with strange key [tests/experimental/cas_invalid_key.phpt]
Memcached::deleteByKey() [tests/experimental/delete_bykey.phpt]
Memcached getDelayed() and fetch() with and without cas [tests/experimental/fetch.phpt]
Memcached::get() [tests/experimental/get.phpt]
Memcached::getByKey() with CAS [tests/experimental/get_bykey_cas.phpt]
Memcached::getDelayedByKey() [tests/experimental/getdelayed_bykey.phpt]
Memcached::getDelayedByKey() with CAS [tests/experimental/getdelayed_bykey_cas.phpt]
Memcached getDelayed non string keys [tests/experimental/getdelayed_nonstring_keys.phpt]
Memcached::getMulti() bad server [tests/experimental/getmulti_badserver.phpt]
Memcached::getMultiByKey() [tests/experimental/getmulti_bykey.phpt]
Memcached::getMulti() with empty array [tests/experimental/getmulti_empty.phpt]
Memcached::phpinfo() [tests/experimental/moduleinfo.phpt]
Compress with 0 factor and get [tests/experimental/setget_zero_factor.phpt]
Memcached::setMultiByKey() with bad serialize [tests/experimental/setmulti_badserialize.phpt]
Memcached::getStats() [tests/experimental/stats.phpt]
Memcached::getStats() with bad server [tests/experimental/stats_badserver.phpt]
=====================================================================

=====================================================================
WARNED TEST SUMMARY
---------------------------------------------------------------------
Memcached store, fetch & touch expired key [tests/expire.phpt] (warn: XFAIL section but test passes)
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.  You can then email it to [email protected] later.
Do you want to send this report now? [Yns]: Y

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text): [email protected]

Posting to http://qa.php.net/buildtest-process.php

Thank you for helping to make PHP better.

... and here is where I got stuck. But when I see you saying about memcached, I realize that I forgot to install it sudo apt-get install memcached. Afff
But now is fixed on the setup script above! :)

Trying to install it, even with tests failing:

ubuntu@host:~/php-memcached$ sudo make install
Installing shared extensions:     /usr/lib/php/20151012/

Installation seems to work, now I can see this information on php info:

ubuntu@host:~/php-memcached$ php -i | grep memcached
/etc/php/7.0/cli/conf.d/20-memcached.ini,
memcached
memcached support => enabled
libmemcached version => 1.0.18
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.compression_type => fastlz => fastlz
memcached.default_binary_protocol => 0 => 0
memcached.default_connect_timeout => 0 => 0
memcached.default_consistent_hash => 0 => 0
memcached.serializer => php => php
memcached.sess_binary_protocol => 1 => 1
memcached.sess_connect_timeout => 0 => 0
memcached.sess_consistent_hash => 1 => 1
memcached.sess_lock_expire => 0 => 0
memcached.sess_lock_max_wait => not set => not set
memcached.sess_lock_retries => 5 => 5
memcached.sess_lock_wait => not set => not set
memcached.sess_lock_wait_max => 2000 => 2000
memcached.sess_lock_wait_min => 1000 => 1000
memcached.sess_locking => 1 => 1
memcached.sess_number_of_replicas => 0 => 0
memcached.sess_persistent => 0 => 0
memcached.sess_prefix => memc.sess. => memc.sess.
memcached.sess_randomize_replica_read => 0 => 0
memcached.sess_remove_failed_servers => 0 => 0
memcached.sess_sasl_password => no value => no value
memcached.sess_sasl_username => no value => no value
memcached.sess_server_failure_limit => 0 => 0
memcached.store_retry_count => 2 => 2

PHPINFO

memcached support => enabled
Version => 3.0.0b1
libmemcached version => 1.0.18
SASL support => no
Session support => yes
igbinary support => no
json support => no
msgpack support => no

And thats when I got it to work fine! Some tests are failing, but my unit test are passing... my app goes to production? What do you think? 👍

@krakjoe
Copy link
Member

krakjoe commented Apr 4, 2016

I'm going to close this bug.

The original issue was a misconfiguration one, not a bug.

The failing tests you are seeing are in the experimental folder, the README is not very precise about how to run tests.

If you want to run tests like travis does, do make test TESTS=tests/*.phpt, this will skip experimental tests.

If you think you have an issue, please open a new ticket.

@krakjoe krakjoe closed this as completed Apr 4, 2016
@emiglobetrotting
Copy link

php-memcached test all skipped with one common reason "cannot connect to server"

I'm trying to install it on Centos 7 and these are my steps

yum -y install memcached libmemcached-devel

made changes in nano /etc/sysconfig/memcached to fit the options below

PORT=”1337″
USER=”memcached”
MAXCONN=”2000″
CACHESIZE=”4096″
OPTIONS=”-l 127.0.0.1”

systemctl restart memcached 

systemctl start memcached

systemctl enable memcached

cd php-src/ext

git clone https://github.com/php-memcached-dev/php-memcached.git

cd php-memcached

/usr/local/php7/bin/phpize

./configure --prefix='/usr/local/php7' --with-libmemcached-dir='/usr' --disable-memcached-sasl --with-php-config='/usr/local/php7/bin/php-config'


make && make install

make test //all test result is skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants