Installing Gettext on OS X 10.11.X El Capitan

Before you get started, you need to make sure some basic requirements are met:

  • You have made a backup of your system.
  • You have the latest version of Apple’s Developer Tools (Xcode 7 or higher for 10.11.x including command line tools) installed. Dev Tools are available as a free download from the Mac App Store

First we need to download and compile gettext.

sudo -s

mkdir -p /topicdesk/sources

cd /topicdesk/sources

curl -O

tar xzf gettext-0.19.6.tar.gz

cd gettext-0.19.6

./configure --prefix=/usr/local/topicdesk


make install

Next we need to get download Apple’s version of PHP from in order to be able to build a dynamic library for PHP.

cd /topicdesk/sources

curl -O

tar xjf php-5.5.30.tar.bz2

cd /topicdesk/sources/php-5.5.30/ext/gettext


./configure --prefix=/usr/local/topicdesk --with-gettext=/usr/local/topicdesk


make install

Unless you have disabled SIP, you will now see an error while the install script tries to move into /usr/lib/php/extensions/no-debug-non-zts-20121212/
This is not a problem and can be solved by manually copying to where we need it.

mkdir -p /usr/local/topicdesk/lib/php/extensions

cp -rp /topicdesk/sources/php-5.5.30/ext/gettext/modules/ /usr/local/topicdesk/lib/php/extensions

Now all we need to do is to modify our /etc/php.ini file and add:


When done, we need to make sure apache is restarted, by issuing:

server-apachectl graceful
1 reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply to Kamga Simo Cancel reply

Your email address will not be published. Required fields are marked *