4

nginx + php-fpm on CentOS, all compiled from sources. Adding memcached support, I compiled libmemcached and php "memcached" extension, added a line `php_admin_value[extension]=memcached.so' in the php-fpm config and restarted php-fpm.

Opening a test php with phpinfo() via web server started showing a section about "memcached" extension (screenshot). However attempts to instantiate the class fail with Fatal error: Class 'Memcached' not found.

I also tried installing the php "memcache" (without 'd') extension in the same way: downloading sources, phpize, configure, make, make install. All the same: listed in phpinfo();, "Class not found" fatal error.

What am I doing wrong, and how can I add a compiled extension to the php-fpm? yum / pecl package managers are not an option currently, as specific versions are required.

Serge
  • 1,531
  • 2
  • 21
  • 44

1 Answers1

1

You set up seems fine. I have the same set up, except my memcache/memcached are installed by yum. So maybe your memcache/memcached not installed properly. The following link mentions a dependency on zlib-devel.

Fatal error: Class 'Memcache' not found (installed with pecl)

Community
  • 1
  • 1
Chuan Ma
  • 9,754
  • 2
  • 45
  • 37
  • Sorry, this didn't change anything. My fault testing this as positive first time. – Serge Mar 16 '13 at 05:56
  • Did you find any error msg in the php-fpm error log? If you run 'php -m' in command line, did php complain something? – Chuan Ma Mar 16 '13 at 12:35