Last active
June 24, 2022 09:28
-
-
Save njt1982/e4403fdd570a86875e29017fc5ead252 to your computer and use it in GitHub Desktop.
Building PHP 5.6 and 7.x on OSX Mojave and Catalina (with Homebrew for dependencies)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch out 5.6 for required version | |
phpbrew install -j $(nproc) 5.6 +default +mysql +fpm +gd \ | |
+bz2="$(brew --prefix bzip2)" \ | |
+curl="$(brew --prefix curl-openssl)" \ | |
+zlib="$(brew --prefix zlib)" | |
# PHP 7.2 needed some tweaks (the mirror and the X11 thing (which helps GD compile)) | |
CPPFLAGS="-I/usr/X11/include" phpbrew install -j $(nproc) \ | |
--mirror=https://www.php.net 7.2 +default +mysql +fpm \ | |
+openssl="$(brew --prefix openssl)" \ | |
+bz2="$(brew --prefix bzip2)" \ | |
+zlib="$(brew --prefix zlib)" +gd | |
# Catalina | |
CPPFLAGS="-I/opt/X11/include" phpbrew install --build-dir="/Volumes/ramdisk/phpbrew/build" -j $(nproc) \ | |
7.2 +default +mysql +fpm \ | |
+openssl="$(brew --prefix openssl)" \ | |
+bz2="$(brew --prefix bzip2)" \ | |
+zlib="$(brew --prefix zlib)" +gd -- \ | |
--with-webp-dir="$(brew --prefix webp)" \ | |
--with-xpm-dir=/opt/X11 | |
CPPFLAGS="-I/opt/X11/include" phpbrew install --build-dir="/Volumes/ramdisk/phpbrew/build" -j $(nproc) \ | |
7.1 +default +mysql +fpm \ | |
+openssl="$(brew --prefix openssl)" \ | |
+bz2="$(brew --prefix bzip2)" \ | |
+zlib="$(brew --prefix zlib)" +gd -- \ | |
--with-webp-dir="$(brew --prefix webp)" \ | |
--with-xpm-dir=/opt/X11 | |
CPPFLAGS="-I/opt/X11/include" phpbrew install -j $(nproc) 7.3 \ | |
+default +mysql +fpm +intl +opcache +soap \ | |
+openssl="$(brew --prefix [email protected])" \ | |
+bz2="$(brew --prefix bzip2)" \ | |
+zlib="$(brew --prefix zlib)" +gd -- \ | |
--with-webp-dir="$(brew --prefix webp)" \ | |
--with-xpm-dir="$(brew --prefix libxpm)" | |
--with-icu-dir="$(brew --prefix icu4c)" \ | |
--with-jpeg-dir="$(brew --prefix jpeg)" \ | |
--with-png-dir="$(brew --prefix libpng)" \ | |
--with-freetype-dir="$(brew --prefix freetype)" \ | |
--with-zlib-dir="$(brew --prefix zlib)" \ | |
--with-xpm-dir=/opt/X11 | |
# Adding GD to PHP 7.3 | |
phpbrew -d ext install gd -- \ | |
--with-webp-dir="$(brew --prefix webp)" \ | |
--with-xpm-dir=/opt/X11 \ | |
--with-jpeg-dir="$(brew --prefix jpeg)" \ | |
--with-png-dir="$(brew --prefix png)" \ | |
--with-freetype-dir="$(brew --prefix freetype)" \ | |
--with-zlib-dir="$(brew --prefix zlib)" | |
# MCrypt extension | |
phpbrew -d ext install mcrypt | |
# PHP 7.4 | |
CPPFLAGS="-I/opt/X11/include" phpbrew install -j $(nproc) 7.4 \ | |
+default +mysql +fpm +intl +opcache +soap \ | |
+openssl="$(brew --prefix [email protected])" \ | |
+bz2="$(brew --prefix bzip2)" \ | |
+zlib="$(brew --prefix zlib)" +gd -- \ | |
--with-webp="$(brew --prefix webp)" \ | |
--with-xpm="$(brew --prefix libxpm)" \ | |
--with-icu="$(brew --prefix icu4c)" \ | |
--with-jpeg="$(brew --prefix jpeg)" \ | |
--with-freetype="$(brew --prefix freetype)" | |
phpbrew -d ext install gd -- \ | |
--with-webp="$(brew --prefix webp)" \ | |
--with-xpm=/opt/X11 \ | |
--with-jpeg="$(brew --prefix jpeg)" \ | |
--with-freetype="$(brew --prefix freetype)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment