Hướng dẫn brew uninstall php

First check your current version on mac. Please enter below command in your terminal.

Ex :- php -v
Output : PHP 7.1.2

Enter next command for uninstall the PHP on your system.

Ex :- brew uninstall

After select new version as you want to install, Please enter below command in your terminal.

Ex :- brew install

If you want to used in your valet system, Then please enter below command.

Ex :- valet use

After check your php version, Your php version updated in your system.

Had the same error (OS Mojave 10.14) with local php 7.1 needing for update. Issue was when trying to install PHP version with homebrew the installation didn't work because of a curl error - solution was to use brewed curl instead of system curl

Initially tried:

brew install shivammathur/php/  

Reponse was:

Error: Failed to download resource "freetds"

used the following command to update the errored package freetds myself:

HOMEBREW_FORCE_BREWED_CURL=1 brew install freetds

After this ran the homebrew php command again (update took very long):

brew install shivammathur/php/ 

Then forced the php7.4 version

 brew link --overwrite --force shivammathur/php/

And then

php -v

And succcess:

PHP 7.4.28 (cli) (built: Apr  3 2022 20:51:36) ( NTS )

Hope this saves someone a day!

Answer found here: reference

Although PHP is really great and is so helpful, especially to aspiring and professional programmers alike, it can still experience many issues. That’s why people want to uninstall PHP on Mac.

All these issues come in many forms. And some issues are not easy to fix. For example, many users still realize that even though they have already uninstalled the PHP application on their Mac it still takes up too much space on their disk.

Here, we will tackle why you are experiencing this issue and how you can fix this. We will also teach you the best method to remove the software from Mac as well as the best cleaning tool you can use for your Mac.

Contents: Common Manual Ways to Uninstall PHP on MacBonus Tip: PowerMyMac Help You to Easily Uninstall Apps on MacConclusion

Common Manual Ways to Uninstall PHP on Mac

PHP is a great application that is used by many people who do open-source scripting and programming. This app is also very great when developing Static websites or Dynamic websites and other Web applications too.

However, even if PHP is entirely great, it can still use a lot of space from your Mac making your software work slowly. When the issues come, many people opt to remove PHP from Mac. But, even though they have already uninstalled the application from their computer, they realized that it still has left a lot of space on their disk.

That’s why it is very important to thoroughly and completely uninstall PHP on Mac without it leaving behind other unnecessary and unwanted files.

Hướng dẫn brew uninstall php

To learn how to successfully uninstall PHP, read the rest of this article below. Here are the common ways you can manually uninstall PHP on Mac.

Method #1: Dragging PHP Icon to your Trash in Finder

  1. Click Finder and tap on the Applications category
  2. Select PHP and drag it to the Trash icon or you can also right-click on it and click Move to Trash
  3. Now, right-click on the Trash icon again and select Empty Trash

Hướng dẫn brew uninstall php

Method #2: Launching the PHP Built-in Uninstaller

  1. Find the PHP installation file on your computer and double-click it to open
  2. Inside the package, click the Uninstaller
  3. Now, from here follow all the on-screen instructions to uninstall PHP on Mac

We understand that uninstalling the PHP application on your Mac can be hard to pull off sometimes that’s why we have a lot of methods available that you can try to make it work. PHP is a large-sized application and has a lot of data and other files that come with it. That's why it is also not very easy to get rid of this application.

If the above methods are still not enough, you can also do another manual uninstallation process to get rid of this PHP app. To do so, follow the steps below. This is to help those who still aren’t able to get rid of all the files that are associated with the PHP app.

Method #3: Uninstall PHP on Mac and delete its leftovers

  1. First, go to Activity Monitor and find the PHP app
  2. Click X and Force Quit the app to stop it from working in the background
  3. Now, go to Finder again and on the Applications category click PHP and click Move to Trash
  4. After that, right-click Trash and click Empty Trash
  5. Next, click Finder again and select Go and then tap on Go to folder
  6. Type in ~/Library and find every file and data that is associated with the PHP app
  7. After finding all of these move them to Trash again
  8. And just like what you did earlier, right-click Trash and Empty Trash again

Hướng dẫn brew uninstall php

Method #4: Uninstall PHP on Mac using Terminal

  1. You can first check the version of your PHP. Open Terminal, then use the command line -php -v to check.
  2. And now you can enter the command for uninstalling the PHP on Mac:- brew uninstall (X.X.X here means the version number of your PHP.)
  3. When deleting a file, you may encounter the following error "rm: php: Read-only file system". The solution is to turn off sip on the system and execute the command sudo mount -uw / in Terminal.

Hướng dẫn brew uninstall php

After that, you now successfully uninstall PHP on Mac. Although it requires a lot of steps it can also do the trick. This method can also get rid of all the data and even caches that are left behind by the PHP app. Now, your computer will work faster and more smoothly than before.

Bonus Tip: PowerMyMac Help You to Easily Uninstall Apps on Mac

There is also another third-party tool that can help you uninstall an app on your computer much faster like how to uninstall PHP on Mac. This tool can indeed uninstall all the other unwanted apps from your computer - iMyMac PowerMyMac.

Get A Free Trial Now!

PowerMyMac can help you delete all junk files, remove duplicate files, and even get rid of all large and old files on your Mac in just a few clicks. With the help of the PowerMyMac, you can clean your Mac and make it much faster in the most reliable way.

With its App Uninstaller, you can easily remove the difficult-to-delete apps like Google Drive or iTunes from the Mac without leaving trace files. This app has made a lot of users happy and satisfied as well so it’s a trusted app! What’s more, it makes its users' privacy its utmost priority so you won’t have to worry about your safety and security!

Hướng dẫn brew uninstall php

There is also no accidental deletion when using the iMyMac PowerMyMac, so what are you still waiting for? Try it now!

Conclusion

Now that we have finally reached the end of this article, we sure do hope that you now have finally learned the different methods to uninstall PHP on Mac. From now on, you won’t have to worry about this application getting so much of your disk space.

Of course, if you also want to automatically uninstall other applications from your Mac, you can also try iMyMac PowerMyMac. This cleaning tool can make cleaning a lot easier for you since it has many features that you will surely enjoy!

Get A Free Trial Now!