Uninstall default PHP on El Capitan

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

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-cliphp-fpm, etc to be removed as well as apache and mysql.

profilepic.png
manpreet 2 years ago

In my opinion, the right way is to set your path to prefer your installation of PHP.

  • Apple restricts PHP so you can't delete it without bypassing the system integrity protection
  • Apple will update those files any time it pleases, so you're always needing to re-do whatever steps you take to modify the system
  • If you make a virtual environment like docker or just using correct paths to your installation, those are portable and don't need any sort of extra work.

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.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.