add php5-memcached?

Bjarne D Mathiesen macintosh at
Tue Feb 23 11:05:25 PST 2010

Ryan Schmidt wrote:
> On Feb 22, 2010, at 07:19, Andrew Sutherland wrote:
>> Hey guys, noob here.
> Welcome!
>> I'm using PHP's memcached extension. Macports hosts pecl's memcache (without the d) but not memcached, which is more fully featured and up to date. Can php5-memcached be added to Macports?
> How strange that there are two extensions for the same purpose. I didn't know. Please file a port request ticket in the issue tracker.

The diferences are specified here :

>> Alternatively/also, how do I get PECL going on PHP? Installing php5 (port install php5) doesn't get me pecl, so I can't add pecl extensions. 
> Also strange. I didn't know our php5 port wasn't providing pecl. That may be a good thing, though; using pecl to install extensions into the MacPorts prefix would confuse MacPorts if we ever add ports for those extensions later. So let's just get it out of the way and make ports for any extensions you need.

line 91 in the portfile for php5 specifies --without-pear
you should be able to get pear  - and thus pecl - by specifying:
port install php5 +pear

I'm building php5-memcached thus :
/macports/bin/port install memcached

declare downloadDir=$( pecl config-show | awk '/download_dir/ {print $NF}' )
mkdir -p ${downloadDir}
cd ${downloadDir}

pecl download memcached

declare memcachedVer=$(ls memcached*)
tar -zxf ${memcachedVer}
cd $( basename ${memcachedVer} .tgz )

./configure \
    --with-libmemcached-dir=/macports \
    --with-zlib-dir=/macports \

make install

my paths etc are different form the standard install of macports so
you'll have to modify the paths according to your installation

Bjarne D Mathiesen
København N ; Danmark ; Europa
denne besked er skrevet i et totalt M$-frit miljø
MacOS X 10.6.2 Snow Leopard ; 2.8GHz Intel Core i7 ; 16GB 1067MHz DDR3

More information about the macports-users mailing list