Installing memcache for MAMP using the wrong version of the API

I am trying to install memcache for MAMP. It seems to configure / do / install fine, but I get an API error message:

[26-Oct-2012 17:40:51 UTC] PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100525 These options need to match in Unknown on line 0 

I am using MAMP 2.1.1 for OS X Mountain Lion.

I use this memcache assembly: http://pecl.php.net/package/memcache/2.2.7

I extracted the archive to this directory: / Applications / MAMP / bin / php / php 5.4.4 / include / memcache-2.2.7

And then they executed these commands from the extracted directory:

 /Applications/MAMP/bin/php/php5.4.4/bin/phpize ./configure make sudo make install 

There are no errors, besides what I noted above, what I see in: / Applications / MAMP / logs / php _error.log

Any ideas on how to fix this?

+4
source share
1 answer

So, after several hours of trying to figure this out, I was able to find the problem and fix it. I am pretty much a huge noob when it comes to all this, but here is the best I can explain, what I think I understand:

So, when I ran the first phpize run in the module, it was configured for my default php installation. I needed to specify php and phpize for my PATH in my .bash_profile

 export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.4.3/bin:/usr/local/bin:$PATH:/opt/local/bin 

Be sure to change the php version to the version you are running on.

After adding this to your path, running phpize -v should return:

 PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 

and running which phpize should return: /Applications/MAMP/bin/php/php5.4.3/bin/phpize

So, it’s just a matter of deleting all the files that were installed for the first time, and restarting the installation process. I unpacked the downloaded cd file into the unpacked folder and ran: / Applications / MAMP / bin / php / php 5.4.3 / bin / phpize. / configure do cp modules / memcache.so / Applications / MAMP / bin / php / php5.4.3 / lib / php / extensions / no-debug-non-zts-20100525 /

And the boom. He works!

This article helped me a lot, although it is not related to memcache: http://drupal.org/node/1464236

+1
source

Source: https://habr.com/ru/post/1442371/


All Articles