up vote 1 down vote favorite
share [g+] share [fb]

I'm trying to install memcache on MAMP but I get the warning below, and when I continue it seems to complete properly. I add the line extension=memcache.so to the php.ini and restart MAMP but phpinfo() doesn't list the memcache extension.

$ ./pecl install memcache
downloading memcache-2.2.5.tgz ...
Starting to download memcache-2.2.5.tgz (35,981 bytes)
..........done: 35,981 bytes
11 source files, building
WARNING: php_bin /Applications/MAMP/bin/php5/bin/php appears to have a suffix 5/bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
Enable memcache session handler support? [yes] : yes

...

Build process completed successfully
Installing '/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/memcache.so'
install ok: channel://pecl.php.net/memcache-2.2.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=memcache.so" to php.ini
link|improve this question
1  
I noticed that the memcache.so extension generated is a 64bit file: $file memcache.so memcache.so: Mach-O 64-bit bundle x86_64 But that the MAMP php binary is 32bit. $file php php: Mach-O universal binary with 2 architectures php (for architecture ppc): Mach-O executable ppc php (for architecture i386): Mach-O executable i386 I'm wondering if this isn't the issue, or if anybody has any other suggestions? – user35346 Feb 18 '10 at 23:54
feedback

3 Answers

Not really an answer. I just can't comment so I'm posting here. I have apache + php installed via darwin ports. apache from ports is not enabled. I have installed MAMP version 1.9 and I'm trying to build the memcache extension into PHP 5.3.2.

I'm following the option 2 instructions for building the memcache PHP extension for MAMP at http://www.lullabot.com/articles/setup-memcached-mamp-sandbox-environment.

When I go to build memcached from

/Applications/MAMP/bin/php5.3/bin/pecl

I get output that seems to indicate that pecl is building for the PHP extension directory previously installed via darwin ports:

WARNING: php_bin /Applications/MAMP/bin/php5/bin/php appears to have a suffix 5/bin/php, but config variable php_suffix does not match
building in /var/tmp/pear-build-bmillett/memcache-2.2.5
running: /private/tmp/pear/temp/memcache/configure --enable-memcache-session=yes
...
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20060613

eventually I end up with:

installing '/usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so' ERROR: failed to write /usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so (copy(/usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so): failed to open stream: Permission denied)

Just for fun, I ran pecl via sudo and grabbed the extension module that was built (for the wrong source it would seem.) When I stuck it in my MAMP extension folder and configured it in php.ini, I get this error:

[18-Jun-2010 15:38:00] PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match

Is there anyway to specify from which config and to where to build this module? Any enlightenment would be great.

Thanks

link|improve this answer
feedback

Okay,

Here's how I got this to install via pecl:

I had installed PHP via darwin ports. When php-config was called, it was calling that file for my PHP 5.2.x installation.

  1. I added a directory to my MAMP installation: mkdir /Applications/MAMP/bin/php5
  2. Depending on which version of PHP I'm running, I link the bin folder. In this instance of building for version 5.3.2, from within the new php5 dir: ln -s ../php5.3/bin
  3. Now, update or modify path from your ~/.profile file: export PATH=/Applications/MAMP/Library/bin/:/Applications/MAMP/bin/php5/bin/:$PATH
  4. MAMP doesn't set the execute bit on php-config for some reason: so cd to the php5/bin folder: chmod +x php-config
  5. Now just run pecl: sudo ./pecl i memcache
link|improve this answer
feedback

I had a similar issue, and was able to resolve it. Hopefully the following is useful for someoene Googling this issue:

I'm running CentOS 5.5 with WHM/CPanel. The problem is that it expects modules to be located in: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/

pecl install memcache installed the module into that path minus "/local/". So I had to simply run

cp /usr/lib/php/extensions/no-debug-non-zts-20060613/memcache.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
/sbin/service httpd stop
/sbin/service httpd start

Merely symlinking didn't work, and I'm fairly sure I had to completely shutdown apache and start it.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.