Install php mcrypt in Mac OS Sierra 10.12

# Install HomeBrew. (https://brew.sh/)
$/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Disable SIP in Mac OS. (http://www.macworld.com/article/2986118/security/how-to-modify-system-integrity-protection-in-el-capitan.html)

The Sierra version ships with PHP 5.6.28 at the time of writing, you can always find the version  from your terminal with php -v command. 

Download the version source from the PHP site (http://php.net/downloads.php) and extract it.

Make sure you enable PHP extension in apache conf and mcrypt extension in /etc/php.ini and it should all be good to go! Reenable SIP as its recommended.

 

Leave a Reply