My Mac has the default installation of PHP 5.5 at /usr/bin/php
and I want to remove it the right way because I want to have PHP 7 instead of this. So far no luck on how to uninstall the right way. I can't simply rm -rf /usr/bin/php
because there's a lot of other components like php-cli
, php-fpm
, etc to be removed as well as apache and mysql.
MacOS – Uninstall default PHP on El Capitan
macosPHP
Related Question
- MacOS – Remove system default / third-party app ‘service’ items from OS X context menus
- MacOS – Changing OS X’s Apache settings to replicate Ubuntu’s Apache environment
- MacOS – Modify “open with” list for file type (not for duplicate removal)
- MacOS – Uninstall/ disable php 5.6.9 osx Yosemite
- MacOS – Uninstall PHP on Mac Mountain Lion
- Installation failure – the mongodb driver for PHP on El Capitan
- MacOS – Stuck in upgrading PHP version on localhost Mojave
- MacOS – How to delete local mail on mac and stop terminal saying “You have mail.”
Best Answer
In my opinion, the right way is to set your path to prefer your installation of PHP.
If you really need to delete those files, you would boot to recovery HD and disable SIP. Then delete all files and associated libraries (with the potential to break Apple tools if you delete something the system actually runs at some point) and then re-enable SIP as desired. I would make a good backup before changing SIP just in case you wish to recover the system after deleting things.