1

What I already did:

  • Download latest stable release from pecl.php.net with wget-
  • Unpack archive
  • Run phpize, ./configure, make, make install, etc..

That stuff went well, now I have:

/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so
/usr/lib/php/extensions/no-debug-non-zts-20100525/memcached.so

In my php.ini (Loaded Configuration File from phpinfo) I added:

extension_dir="/usr/lib/php/extensions/no-debug-non-zts-20100525/"
extension=memcached.so
extension=apc.so

But the problem is, the libraries are not beeing loaded, the correspondent sections in phpinfo() are missing. I have tried to:

  • Restart apache
  • Comment out "extension_dir"
  • Use "zend_extension" instead of "extension"
  • Specify the full path to the .so files

Restart of XAMPP happens without problems, no error log is generated. Anyone of you have an idea what could be wrong here?

1
  • Seems like i found the issue, but how can i force PECL to use the correct API version? PHP Warning: PHP Startup: memcached: Unable to initialize module Module compiled with module API=20100525 PHP compiled with module API=20121212 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: apc: Unable to initialize module Module compiled with module API=20100525 PHP compiled with module API=20121212 These options need to match in Unknown on line 0
    – disputable
    Commented Jul 21, 2014 at 17:24

1 Answer 1

1

If you've installed XAMPP then you'll have two versions of PHP on your system. I think the problem is that you are using the XAMPP version of PHP, but the extensions have been compiled against the OS bundled version.

If you are using XAMPP then you'll need to use the toolchain that comes with XAMPP. For example, try sudo /Applications/XAMPP/xamppfiles/bin/pecl install memcached, this seems to download, build and install memcached correctly for me so that XAMPP can use it.

After that I just needed to add the extension=memcached.so line to php.ini and now memcached is appearing in phpinfo().

1
  • Your solution did not work for me (same result as before), but finally the way to do it was very close: /Applications/XAMPP/xamppfiles/bin/phpize ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config-5.5.9
    – disputable
    Commented Jul 22, 2014 at 6:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .