Skip to content

Instantly share code, notes, and snippets.

@deardooley
Created June 29, 2020 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deardooley/5eb2d24cf58e96bb35f9ac7dc6d12833 to your computer and use it in GitHub Desktop.
Save deardooley/5eb2d24cf58e96bb35f9ac7dc6d12833 to your computer and use it in GitHub Desktop.
Installing the now deprecated Homebrew php@7.1 on macOS
To install the deprecated php@7.1 on macOS using Homebrew, run the following commands:
```bash
git -C "$(brew — repo homebrew/core)" checkout d541efc^ — Formula/php@7.1.rb
brew install php@7.1
pecl install xdebug
pecl install igbinary
pecl install redis
```
If you are using PHPStorm as your IDE, you can configure xdebug by removing the extension lines added to your php.ini file by default and adding the following files to the `/usr/local/homebrew/etc/php/7.1/conf.d` folder.
```ini
; ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/homebrew/lib/php/pecl/20160303/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port="9000"
```
```ini
; ext-igbinary.ini
[xdebug]
extension="/usr/local/homebrew/lib/php/pecl/20160303/igbinary.so"
```
```ini
; ext-redis.ini
[xdebug]
extension="/usr/local/homebrew/lib/php/pecl/20160303/redis.so"
```
Make sure and update your PHP interpreter in PHPStorm to point at your homebrew PHP@7.1 install binary `/usr/local/homebrew/Cellar/php@7.1/7.1.33/bin/php`. Once seet, the above settings should allow you to use the PHP debugger in PHPStorm with the default settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment