PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Jim Plush's Blog: Fix when compiling the Redis php extension on OSX - mach-o, but wrong architecture

Note: This article was originally published at PHPDeveloper on 15 September 2010.
PHPDeveloper

When trying to load in the Redis module for his PHP installation, Jim Plush was getting an error:

PHP Warning: PHP Startup: Unable to load dynamic library '/[...]/redis.so' - dlopen(/[...]/redis.so, 9): no suitable image found. Did find: /[...]/redis.so: mach-o, but wrong architecture in Unknown on line 0

He fixed the issue with the help of a bash script (source included) that sets up the right environment to build PHP on the OSX platform. Then the normal make, phpize, etc process can be done on the PECL extension and have it compile correctly.