Can I install the memcached PHP extension with PECL?

一曲冷凌霜 提交于 2019-12-02 17:19:57

Andrei Zmievski (developer of the memcached plugin) kindly answered my email request with the following instructions:

$ pecl download memcached
$ tar zxvf memcached-1.0.0.tgz (or whatever version downloads)
$ cd memcached-1.0.0
$ phpize
$ ./configure --with-libmemcached-dir=/opt/local
$ make
$ sudo make install

This worked perfectly.

As you've seen, the new memcached extension, uses libmemcached to do the heavy lifting. If it were Linux, I'd say that it was possible that you don't have /opt/local/lib/ listed in ld.so.conf (and run 'ldconfig').

MaxOSX doesn't use that though. It is, however installable from 'ports' apparently. http://lsimons.wordpress.com/2008/05/01/serious-php-part-1/

same situation here. i had to do the above, but with explicit path names (i run my php etc. out of /opt/local)

  • /opt/local/bin/pecl download memcached
  • tar zxvf memcached-1.0.0.tgz
  • cd memcached-1.0.0
  • /opt/local/bin/phpize
  • ./configure --prefix=/opt/local --with-php-config=/opt/local/bin/php-config --with-libmemcached-dir=/opt/local
  • make
  • make install

normally this kind of stuff is pretty simple on os x with macports, but there is no php5-memcached package yet (only one for the older, memcache (no "d") package). oh, an i also had to install an older version of libmemcached, since the latest version didn't compile on os x 10.5.8 for me. oy!

Well, after many tries only this solution works for me.

  1. Install XAMPP
  2. Install brew (https://github.com/Homebrew/homebrew/wiki/Installation)
  3. $ brew
  4. install libmemcached
  5. cd /Applications/XAMPP/xamppfiles/bin/
  6. $ sudo ./pecl install memcached

Build process completed successfully Installing '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/memcached.so' install ok: channel://pecl.php.net/memcached-2.2.0 configuration option "php_ini" is not set to php.ini location You should add "extension=memcached.so" to php.ini

VOILA !!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!