One of the worst things that could have happened to me upgrading to Mac OS X 10.10.1 Yosemite is the fact that reset the configuration of Apache / PHP. Basically, deleted the php.ini file (among other things) and get text and mcrypt libraries.
The first thing we do is install gettext in Yosemite. I am not sure if this step is absolutely necessary.
I usually work in the tmp folder and restarting the Mac (though I do not ever do) is automatically deleted. We open the Terminal and put:
1 | cd /tmp |
gettext
Download gettext-tools
1 2 | curl -O https://ftp.gnu.org/pub/gnu/gettext/gettext-lastest.tar.gz tar xvzf gettext-lastest.tar.gz |
In my case, the version 0.19.3, enter into the folder and compile:
1 2 3 4 | cd gettext-0.19.3 sudo ./configure sudo make sudo make install |
Now that we have gettext-tools, compile PHP extensions. For this, use GIT:
Again tmp:
1 | cd /tmp |
And download the PHP sources :
1 | git clone https://github.com/php/php-src.git |
It will be one while downloading code, the PHP project is not tiny. We switched to the branch of our version of PHP:
1 2 | cd php-src git checkout `php -r 'echo "php-".PHP_VERSION;'` |
And finally, compile the extension:
1 2 3 4 | cd ext/gettext sudo phpize sudo ./configure sudo make |
Now we have the extension, copy the folder extensions:
1 | cp modules/gettext.so /usr/lib/php/extensions/no-debug-non-zts-20121212/ |
The folder name may vary depending on the version of OS X.
Now edit php.ini (if you do not have php.ini cp /etc/php.ini.default /etc/php.ini):
1 | sudo nano /etc/php.ini |
Go to the end of the file and add:
1 2 | [gettext] extension = /usr/lib/php/extensions/no-debug-non-zts-20121212/gettext.so |
mcrypt
Now, the extension mcrypt. The process is identical to gettext:
1 2 3 4 | cd ext/mcrypt sudo phpize sudo ./configure sudo make |
Copy of the folder the extensions:
1 | cp modules/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20121212/ |
Now edit php.ini :
1 | sudo nano /etc/php.ini |
Go to the end of the file and add:
1 2 | [mcrypt] extension = /usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so |
Restart apache:
1 | sudo apachectl restart |
Conclusion
Yosemite is fast, Yosemite is nice but has not taken into account, in any case, developers who use the Mac as a development environment.