Leaseweb / LswMemcacheBundle

Symfony bundle for Memcache Doctrine caching and session storage in the Web Debug Toolbar.
MIT License
202 stars 57 forks source link

Cannot use memcached at php 7.0 because of missing Memcache #100

Open pohlaniacz opened 7 years ago

pohlaniacz commented 7 years ago

Hi, I can't install php5-memcache because it's not available at Debian with php 7.0, so I'm getting an error "Memcache extension is not loaded! To configure pools it MUST be loaded!". Of course memcached extensions is loaded properly, how can I fix/bypass this?

mevdschee commented 7 years ago

@pohlaniacz I'm afraid you can't because there is a memcache and a memcached (with a "d") extension. The memcached extension is not supported. You may have to install the memcache extension via PECL.

pohlaniacz commented 7 years ago

I know it, but I though that there is a workaround or I'm missing something. .

skoop commented 6 years ago

I'm running into this as well, and installing memcache via PECL seems to not be that easy on PHP 7.1. Given the memcache extension is sort of deprecated, is there any chance of a newer version of this bundle using memcached?

mevdschee commented 6 years ago

Given the memcache extension is sort of deprecated

Is it? Do you have a reference?

any chance of a newer version of this bundle using memcached?

I tried hard to implement it, but without much luck. Some of the object interfaces of memcached are not fully PHP compatible (parameters that are references and optional if I recall correctly).

I think you are better of with memcache than with memcached. Also memcached does (or at least did) not support windows users (AFAIK).

skoop commented 6 years ago

memcache extension is not packaged with PHP anymore, and if you try to build it on PHP 7.1 you get errors because some PHP header files are renamed in PHP7.

For now I've solved the problem by using a fork of the memcache extension that is still maintained (https://github.com/websupport-sk/pecl-memcache) but as you can see from the official PECL page the last release was in 2013: http://pecl.php.net/package/memcache.

This means I've now been able to upgrade our development docker containers to PHP 7.1 with the above memcache extension, but I'm not sure if our sysadmins will be willing to upgrade production to such a fork.

Memcached on the other hand still has a recent release (and pretty regular updates anyway): http://pecl.php.net/package/memcached

It might be worth looking at re-implementing Memcached support. I've unfortunately not got enough time for it in the upcoming weeks to have a look at this but will see if my client has some time to free up to experiment with this.

mevdschee commented 6 years ago

memcache extension is not packaged with PHP anymore

Nor is or was the php memcached extension.

Memcached on the other hand still has a recent release

But is notoriously known for it's bad support on Windows.

It might be worth looking at re-implementing Memcached support.

AFAIK distributions (such as Debian and Centos) have chosen to build and include the beta versions (of php-memcache). So IMHO you better invest time in getting official builds of php-memcache out, then to rework this package from one sub-par dependency to the other. Honest advice, really :-)