On Mon, Oct 26, 2009 at 11:59 AM, Tom Barrett <t...@miramedia.co.uk> wrote:
> 2009/10/26 Eddie Drapkin <oorza...@gmail.com>:
>> On Mon, Oct 26, 2009 at 11:45 AM, Tom Barrett <t...@miramedia.co.uk> wrote:
>>> I have installed:
>>> - libevent
>>> - libmemcached (http://tangent.org/552/libmemcached.html)
>>> - Done a PECL installation (pecl download memcached, phpize &&
>>> ./configure && make)
>>> - memcached
>>>> cat /etc/php.d/memcached.ini
>>> ; Memcached default settings
>>>> ls -1 /usr/lib64/php/modules/memcache*
>>>> memcached -h
>>> memcached 1.2.6
>>>> php -v
>>> PHP 5.1.6 (cli) (built: Feb 26 2009 07:01:12)
>>> Copyright (c) 1997-2006 The PHP Group
>>> Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
>>> /var/www/php_fcgi_memcache> cat memcache.php
>>> $memcache = new Memcache;
>>> /var/www/php_fcgi_memcache> php memcache.php
>>> PHP Fatal error: Class 'Memcache' not found in
>>> /var/www/php_fcgi_memcache/memcache.php on line 2
>>> Memcached is working fine (being use by Perl quite happily).
>>> PHP/FCGI is working OK and phpinfo() shows:
>>> memcached support enabled
>>> Version 1.0.0
>>> libmemcached version 0.34
>>> Session support yes
>>> Any pointers in the right direction would so very much appreciated.
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>> Try instantiating a Memcached instance, not a Memcache instance.
>> They're two different PECL extensions!
> That just auto-instantiates an empty object?
>> cat memcached.php
> $memcache = new Memcached;
>> php memcached.php
> Memcached Object
> I have used the $m=new Memcache; syntax on another server, which works fine.
> Or have I mixed up my libraries somehow?
They're actually two different classes from two different PECL
extensions. Memcached is the newer (imo better) extension written by
Andrei (at digg) to use libmemcached. Memcache is the older, entirely
custom (no external deps) PECL extension that's been around forever.
So, I'm guessing you have Memcache on one machine and Memcached on
another. They have slightly different APIs, so I'd make sure you're
aware of which one you're using. :)
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php