Installing gettext on Mac OSX 10.9
I understand, English is de-facto language of the web, and clients rarely need multilingual web apps, but not including gettext in the stock php installed on mac is just silly.
(don’t have wget? brew install wget, don’t have brew? install it!)
We start by downloading latest gettext source, and php source matching stock php version installed on your machine (in terminal type php -v).
1 2 3 4 |
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz wget --content-disposition http://ar2.php.net/get/php-5.4.24.tar.gz/from/this/mirror tar -xzf gettext-0.18.3.1.tar.gz tar -xzf php-5.4.24.tar.gz |
Lets make gettext first:
1 2 3 4 |
cd gettext-0.18.3.1 ./configure make sudo make install |
Now lets go to php source:
1 2 3 4 |
cd php-5.4.24/ext/gettext phpize ./configure --with-gettext make |
Don’t make install php, instead copy .so file to your stock php installation:
1 |
sudo cp modules/gettext.so /usr/lib/php/extensions/no-debug-non-zts-20100525/ |
And inside php.ini enable gettext:
1 |
extension=gettext.so |
Restart apache:
1 |
sudo apachectl restart |
And you are done!
Leave a Reply