Skip to content

Instantly share code, notes, and snippets.

@mikenk2010
Last active September 11, 2023 14:30
Show Gist options
  • Save mikenk2010/242f26f92af8df07c0b372bb70d2a2f5 to your computer and use it in GitHub Desktop.
Save mikenk2010/242f26f92af8df07c0b372bb70d2a2f5 to your computer and use it in GitHub Desktop.
Install PHP-7.2 + Xdebug in MacOS Catalina + PHPStorm
Step 1 - Clean current php
- List all php installed
`brew list | grep php`
- Remove all PHP
`brew uninstall --force php*`
- Install PHP 7.2
`brew install [email protected]`
*Note: if run `brew install php` <== will install PHP 7.4, it's good but still missing many lib, I prefer 7.2
- Add config to .bash_profile
```
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
```
- Run `source ~/.bash_profile`
- Install Xdebug
`pecl install xdebug-2.6.0` <== well support for PHP 7.2
- Update PHP Storm (https://www.jetbrains.com/help/phpstorm/debugging-a-php-cli-script.html)
@TMWagner
Copy link

TMWagner commented Jan 26, 2021

This is one of the most succinct overviews of PHP/Xdebug/PHPstorm integrations I've seen
Unfortunately, it is a bit dated.

Is there an update to this to reflect more current versions of PHP and Xdebug (see https://xdebug.org/docs/install#pecl)

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