I’m attempting to install the PHP pecl memcache extension on my Mac for my local development environment, and it will only install the 64 bit version which is not compatible with 32 bit php from XAMPP.
These are the steps I’ve taken:
cd /tmp/
c-66-31-208-39:/tmp casey$ pecl download memcache-2.2.5
c-66-31-208-39:/tmp casey$ tar xzf memcache-2.2.5.tgz
c-66-31-208-39:/tmp casey$ cd memcache-2.5.5
c-66-31-208-39:memcache-2.2.5 casey$ sudo /Applications/XAMPP/xamppfiles/bin/phpize-5.3.1 MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64'
c-66-31-208-39:memcache-2.2.5 casey$ ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config-5.3.1
c-66-31-208-39:memcache-2.2.5 casey$ make
c-66-31-208-39:memcache-2.2.5 casey$ sudo make install
After all of that completes successfully, I run:
c-66-31-208-39:memcache-2.2.5 casey$ file /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/memcache.so
/Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/memcache.so: Mach-O 64-bit bundle x86_64
And it’s the 64 bit version? I’m not an expert on building software from source, can anyone tell me what I’m doing incorrectly?
configureline needsCFLAGSas well.something like:
You might want the
-O3and-fno-commonfrom the lines above in there as well.