- How to Uninstall PHP, Apache and MySQL on Ubuntu 20.04 LTS
- How To completely uninstall PHP 8.X in ubuntu?
- How To completely uninstall PHP 8.X in ubuntu?
- Solution 1: Run this command
- How To Install/Uninstall PHP on Debian 11
- Step1: Opening Terminal
- Step2: Debian Update and Upgrade
- Step3: Adding Sury APT repository
- Step4: PHP 8 installation on Debian 11
- Step5: PHP8 Extensions
- Uninstall/Remove PHP on Debian 11
- Conclusion
How to Uninstall PHP, Apache and MySQL on Ubuntu 20.04 LTS
This blog will help you how to uninstall or remove PHP, Apache and MySQL on Ubuntu LTS of any version. Step by step commands has been given in this blog. So if your are facing any issue I suggest you to please watch the video that is provided below.
sudo apt-get remove –purge php*
sudo apt-get purge php*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade
Warning below command will do completely remove any package with a name that starts with php and anything related to it.
So, DON’T PRESS “y” UNTIL YOU ENSURE that in the removing packages list there are no other packages (besides related to php packages), like:
sudo apt-get remove –purge php7.2*
sudo apt-get purge php7.2*
sudo apt-get purge `dpkg -l | grep php7.2| awk '' |tr "n" " "`
whereis php
sudo rm -rf /etc/php
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade
Now we remove Apache2 from Ubuntu.
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove
Finally we are removing MySql from Ubuntu.
sudo apt-get remove –purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-php
sudo apt-get dist-upgrade
Removing directories from their respective default locations.
sudo rm -rf /etc/apache2
sudo rm -rf /etc/php
sudo rm -rf /var/lib/mysql
sudo rm etc/mysql
Congratulation you have successfully uninstalled or removed LAMP- PHP, apache2, and Mysql from Ubuntu Operating System. Let me know in the comment box if you are facing any difficulties while executing above commands.
How To completely uninstall PHP 8.X in ubuntu?
Hello Guy How are you all? Hope You all are fine. Today in this tutorial we are going to learn about How To completely uninstall PHP in ubuntu? In this tutorial, We will Discuss all possible methods to uninstall PHP from the ubuntu server. So Let’s start this article without wasting your time.
How To completely uninstall PHP 8.X in ubuntu?
How To completely uninstall PHP in ubuntu?
To completely uninstall PHP in ubuntu Just Run purge, autoclean and autoremove command in your server, and this command will completely uninstall your PHP from your Ubuntu server. So follow all commands one by one. First Of all, You just need to run the purge command. Just run this command in your terminal: sudo apt-get purge php8.* The above command will Uninstall Any of the PHP 8.X versions of PHP installed on your Server. Now we need to cleans obsolete deb-packages to do so we need to run autoclean command: sudo apt-get autoclean After that, we need to remove orphaned packages that are no longer needed from the system so run autoremove command just like this: sudo apt-get autoremove And Now, You have Successfully Uninstalled PHP from your system. Thank You.
completely uninstall PHP in ubuntu
Solution 1: Run this command
To completely uninstall PHP in ubuntu Just Run purge, autoclean and autoremove command in your server, and this command will completely uninstall your PHP from your Ubuntu server. So follow all commands one by one.
First Of all, You just need to run the purge command. Just run this command in your terminal.
How To Install/Uninstall PHP on Debian 11
PHP is one of the oldest and most popular languages in computer science. It is widely used for server-side programming. The popularity is because of its active community. It was first developed in 1994 by Rasmus Lerdorf.
PHP 8.0 is the newer version of PHP language which is also usable for commercial purposes. It is a cross-platform language which means it is executable on all the major operating systems. These Operating systems include Ubuntu, Windows, macOS, etc.
Today in this article, we will teach you how to install PHP on Debian 11. We will also tell you how to uninstall PHP on Debian 11. So sit tight, be with us and learn something new.
Step1: Opening Terminal
First, we have to open the terminal by clicking on the Activities keyword at the top left corner of the screen.
Once you have clicked on the Activities keyword you’ll see a search bar. Type terminal in the search bar. After this click on the terminal.
Terminal Screen will appear.
Step2: Debian Update and Upgrade
In this step, we are going to first update our Debian packages and then upgrade them if necessary. To update the packages type the following in your terminal:
If you see “All packages are up to date” then you don’t need to upgrade.
However, if there are some packages that need upgrading type the following command in your terminal:
Your system is now updated and upgraded.
Step3: Adding Sury APT repository
All the packages of PHP 8 are available on the following link for the Debian system:
To install the required dependency type the following command:
$ sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common
Now after this, to our Debian server we have to add PHP packages APT repository. For this purpose type the following command in your terminal:
$ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
The following output will be generated:
The next step involves importing the repository key for which we have to type the following command in our terminal:
$ wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
Now that we have added the repository key, let’s run the update command again to see whether the repository has been added or not:
Step4: PHP 8 installation on Debian 11
Now that we are done with adding the repository, let us start installing PHP 8 on Debian 11.
The first command that you need to type in your terminal is the following:
The above command will install php8.0 on your Debian 11 system.
You can also specify some other version in the above command instead of 8.0.
Now that we have installed PHP 8.0 let us check whether it was installed successfully or not. For this purpose type the following command in your terminal:
Step5: PHP8 Extensions
We are done with the installation of PHP on our Debian 11 system Let us now look at how to install extensions of PHP 8 on Debian. For this purpose you can use the following command:
$ sudo apt install php8.0-extention
Keep in mind that you have to replace the keyword extension from the above command and replace it with the extension you want. As an example we will install bcmath extension through the following command:
$ sudo apt install php8.0-bcmath
To see all the loaded PHP modules type the following command:
Uninstall/Remove PHP on Debian 11
We have successfully installed PHP on our Debian system. However, there are times where we have to uninstall the PHP from our system. Don’t worry. We are with you. Let us show you how to uninstall PHP on Debian 11.
The first step is to find out which version you have installed on your Debian 11. For this purpose type the following command:
Now that we know which version we are using, type the following command in your terminal to uninstall PHP:
Based on your version, you can replace the version in the above command.
Now type the following command to completely remove it from your system:
Now when you run the following command you won’t be able to see the version:
Congratulations! You have successfully uninstalled PHP from your Debian 11 system.
Conclusion
PHP 8.0 is the latest version of PHP and is an improvement to the PHP 7.4 version. PHP has a very huge community and most websites are developed using PHP.
In this article, we saw how to install PHP on Debian 11. The steps that were taken in installing PHP were updating and upgrading packages, adding a sury apt repository, installation of PHP 8. We also talked about how to install PHP extensions on Debian. In the end, we saw how to uninstall PHP on Debian 11.
TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY