Back by popular demand i.e. someone was struggling with ciphers in PHP and doing so on my dime. This will be quicker than prior implementations as we are going to dispense with building libmcrypt from source, as well as roll 64-bit only.
First, grab/do the following …
1) PHP 7.1.23 source code, which is available here; it is what my machine was running as of late, but you should use php -v to check your version of PHP and then download the PHP source for that version;
2) Xcode 10.2.1, available from the Mac App Store; you will also need the Command Line Tools (macOS 10.14) for Xcode, which you get by selecting “Xcode/Open Developer Tool/More Developer Tools…” from the Xcode menu, then logging into your Apple Developer account; it was at the top of the list as of the morning this post was written;
3) Homebrew (http://brew.sh) which can be installed by typing ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/ install/master/install)” at the command line; I removed Homebrew completely then reinstalled, rather than deal with updates, permissions issues, etc. that might arise after numerous macOS updates/upgrades;
4) Turn off System Integrity Protection (SIP):
- Click the Apple menu (upper left hand corner of your screen)
- Select Restart, then hold down the Command-R keys to boot into Recovery Mode
- Select the Utilities menu and then Terminal
- In Terminal, type csrutil disable and then hit return; then close Terminal
- Click the Apple menu and select Restart
- When you are done installing mcrypt, you can restart SIP by following the above steps while using csrutil enable.