Skip to content

Instantly share code, notes, and snippets.

@mikenk2010
Last active September 11, 2023 14:30
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 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 php@7.2`
*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/php@7.2/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/php@7.2/lib"
export CPPFLAGS="-I/usr/local/opt/php@7.2/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