Last active
September 11, 2023 14:30
-
-
Save mikenk2010/242f26f92af8df07c0b372bb70d2a2f5 to your computer and use it in GitHub Desktop.
Install PHP-7.2 + Xdebug in MacOS Catalina + PHPStorm
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
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)