Skip to content

Instantly share code, notes, and snippets.

@abenevaut
Last active March 9, 2024 23:55
Show Gist options
  • Save abenevaut/59418631f7135d19b81f62006c420b34 to your computer and use it in GitHub Desktop.
Save abenevaut/59418631f7135d19b81f62006c420b34 to your computer and use it in GitHub Desktop.

Install phpbrew && php 7.1.32 on macOS

xcode-select --install

# You should install brew https://brew.sh/index_fr
brew install automake autoconf curl pcre bison re2c mhash libtool icu4c gettext jpeg openssl libxml2 mcrypt gmp libevent zlib libzip bzip2 imagemagick pkg-config
brew link icu4c
brew link --force openssl
brew link --force libxml2

curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
chmod +x phpbrew
sudo mv phpbrew /usr/local/bin/phpbrew

phpbrew init
echo "[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc" >> ~/.bashrc
# See also https://github.com/phpbrew/phpbrew#variants
phpbrew --debug install php-7.1.32 +default +sqlite +mysql +bz2=/usr/local/Cellar/bzip2/1.0.6_1/ +zlib=/usr/local/Cellar/zlib/1.2.11/

#
# Note: php.ini path
# ~/.phpbrew/php/php-7.1.32/etc/php.ini
#

# See also https://github.com/phpbrew/phpbrew#installing-extra-apps
phpbrew app get phpunit
phpbrew app get phpcs
phpbrew app get composer
# See also https://github.com/phpbrew/phpbrew/wiki/Extension-Installer
phpbrew ext install xdebug stable
phpbrew ext install intl stable
phpbrew ext install soap stable
phpbrew ext install gmp stable
phpbrew ext install gd stable -- --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/
phpbrew ext install exif stable
phpbrew --debug ext install imagick stable  -- --with-imagick=/usr/local/Cellar/imagemagick/7.0.8-43/
// ~/.phpbrew/php/php-7.1.32/var/db/xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.show_error_trace = 1
xdebug.remote_autostart = 1
xdebug.file_link_format = phpstorm://open?%f:%l
@abenevaut
Copy link
Author

Not maintained
last update 2019/10/03

@abenevaut
Copy link
Author

Note : Symfony2 do not support latest icu4c version, so you can switch to 63.1 (tested)

brew info icu4c
brew switch icu4c 63.1

https://stackoverflow.com/questions/53828891/dyld-library-not-loaded-usr-local-opt-icu4c-lib-libicui18n-62-dylib-error-run?answertab=active#tab-top

@abenevaut
Copy link
Author

tail ~/.phpbrew/php/php-7.1.32/var/log/php_errors.log

@abenevaut
Copy link
Author

phpbrew extension install intl -- --with-icu-dir=$(brew --prefix icu4c)

@abenevaut
Copy link
Author

phpbrew ext install gd \-- --with-jpeg-dir=/usr/local/Cellar/jpeg/8d/lib --with-zlib-dir=/usr/local/opt/zlib/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment