Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question

put on hold as off-topic by Michael Hampton 2 days ago

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Michael Hampton
If this question can be reworded to fit the rules in the help center, please edit the 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

3 Answers 3

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
share|improve this answer
    
bin: No such file or directory. Not sure how you managed to cd into the php5/bin folder... –  stwhite Jan 30 '13 at 21:43

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.

share|improve this answer

Seems that its regexing for 'php' in the filename and halts around it? I guess its trying to stop before it hits the bin/ folder.

I ended up symlinking my PHP location to ~/pecl_sucks then pecl config-set php_bin "~/pecl_sucks" and it finally worked. Silly.

share|improve this answer

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