Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compile and install gettext.so PHP extension for Mac OS X 10.8 Mountain Lion
#!/usr/bin/sh
# Scipt for installing mcrypt.so extension for PHP 5.3.13 (default PHP for OS X 10.8 Mountain Lion)
mkdir /tmp/gettext
cd /tmp/gettext
curl --location --progress-bar http://us.php.net/get/php-5.3.13.tar.gz/from/nl.php.net/mirror | tar -zx
brew update
brew install gettext
cd /tmp/gettext/php-5.3.13/ext/gettext/
phpize
./configure --with-gettext=/usr/local/Cellar/gettext/0.18.1.1
make
sudo cp modules/gettext.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
cd ~ && rm -rf /tmp/gettext
echo "Don't forget to add 'extension=gettext.so' to /etc/php.ini"
@seitsu

This comment has been minimized.

Copy link

@seitsu seitsu commented Mar 7, 2013

I tried it, but am I missing something?

$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/gettext.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/gettext.so, 9): Library not loaded: /usr/local/lib/libintl.8.dylib
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20090626/gettext.so
Reason: no suitable image found. Did find:
/usr/local/lib/libintl.8.dylib: no matching architecture in universal wrapper
/usr/local/lib/libintl.8.dylib: no matching architecture in universal wrapper in Unknown on line

@seitsu

This comment has been minimized.

Copy link

@seitsu seitsu commented Mar 8, 2013

Found it.

There is a libintl.dylib within gettext.

cd /usr/local/lib
sudo mv libintl.dylib libintl.dylib.old
sudo mv libintl.8.dylib libintl.8.dylib.old
sudo ln -s /usr/local/Cellar/gettext/0.18.2/lib/libintl.8.dylib ./libintl.dylib
sudo ln -s /usr/local/Cellar/gettext/0.18.2/lib/libintl.8.dylib ./libintl.8.dylib
sudo apachectl restart
@arpitHub

This comment has been minimized.

Copy link

@arpitHub arpitHub commented Aug 2, 2013

Works perfect. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment